Title: [120752] trunk/LayoutTests
- Revision
- 120752
- Author
- [email protected]
- Date
- 2012-06-19 14:12:46 -0700 (Tue, 19 Jun 2012)
Log Message
[Chromium] Add LayoutTests for find in page.
https://bugs.webkit.org/show_bug.cgi?id=89453
Patch by Martin Kosiba <[email protected]> on 2012-06-19
Reviewed by Adam Barth.
* platform/chromium/editing/text-iterator/findString-restarts-at-last-position-expected.txt: Added.
* platform/chromium/editing/text-iterator/findString-restarts-at-last-position.html: Added.
* platform/chromium/editing/text-iterator/findString-start-search-after-selection-expected.txt: Added.
* platform/chromium/editing/text-iterator/findString-start-search-after-selection.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (120751 => 120752)
--- trunk/LayoutTests/ChangeLog 2012-06-19 21:06:08 UTC (rev 120751)
+++ trunk/LayoutTests/ChangeLog 2012-06-19 21:12:46 UTC (rev 120752)
@@ -1,3 +1,15 @@
+2012-06-19 Martin Kosiba <[email protected]>
+
+ [Chromium] Add LayoutTests for find in page.
+ https://bugs.webkit.org/show_bug.cgi?id=89453
+
+ Reviewed by Adam Barth.
+
+ * platform/chromium/editing/text-iterator/findString-restarts-at-last-position-expected.txt: Added.
+ * platform/chromium/editing/text-iterator/findString-restarts-at-last-position.html: Added.
+ * platform/chromium/editing/text-iterator/findString-start-search-after-selection-expected.txt: Added.
+ * platform/chromium/editing/text-iterator/findString-start-search-after-selection.html: Added.
+
2012-06-19 Adrienne Walker <[email protected]>
Fix scrollbar layers being misplaced with a clipped owner layer
Added: trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-restarts-at-last-position-expected.txt (0 => 120752)
--- trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-restarts-at-last-position-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-restarts-at-last-position-expected.txt 2012-06-19 21:12:46 UTC (rev 120752)
@@ -0,0 +1,8 @@
+Failure: If the second search ends up finding the text in this line we didn't restart the search from the last active match: last_step.
+Start: The first search should match this word: first_step.
+Success: The second search should match this word: last_step. Subsequent searches should fail.
+PASS testRunner.findString("first_", []) is true
+PASS testRunner.findString("first_step", []) is true
+PASS testRunner.findString("last_step", []) is true
+PASS testRunner.findString("last_step", []) is false
+
Added: trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-restarts-at-last-position.html (0 => 120752)
--- trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-restarts-at-last-position.html (rev 0)
+++ trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-restarts-at-last-position.html 2012-06-19 21:12:46 UTC (rev 120752)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src="" language="_javascript_" type="text/_javascript_"></script>
+<title>Testing that searching for text restarts at the last active match.</title>
+</head>
+<body>
+ <div id="container">
+ Failure: If the second search ends up finding the text in this line we didn't restart the search from the last active match: last_step.<br />
+ Start: The first search should match this word: first_step.<br />
+ Success: The second search should match this word: last_step. Subsequent searches should fail.
+ </div>
+<pre id="console" style="visibility: hidden;"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
+}
+
+if (!window.testRunner)
+ testFailed('This test requires the testRunner object');
+else {
+ shouldBeTrue('testRunner.findString("first_", [])');
+ shouldBeTrue('testRunner.findString("first_step", [])');
+ shouldBeTrue('testRunner.findString("last_step", [])');
+ shouldBeFalse('testRunner.findString("last_step", [])');
+}
+
+document.getElementById("console").style.removeProperty("visibility");
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-start-search-after-selection-expected.txt (0 => 120752)
--- trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-start-search-after-selection-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-start-search-after-selection-expected.txt 2012-06-19 21:12:46 UTC (rev 120752)
@@ -0,0 +1,11 @@
+The _before_selection_ word is before the selection, so we shouldn't be able to find it if span_to_select is selected.
+The _in_selection_ word is in the selection and we should always be able to find it.
+The _after_selection_ word is after the selection and we should always be able to find that too.
+PASS testRunner.findString("_before_selection_", []) is true
+PASS testRunner.findString("_in_selection_", []) is true
+PASS testRunner.findString("_after_selection_", []) is true
+Selecting some text. This should make it not possible to find the _before_selection_ word without enabling wrap-around.
+PASS testRunner.findString("_before_selection_", []) is false
+PASS testRunner.findString("_in_selection_", []) is true
+PASS testRunner.findString("_after_selection_", []) is true
+
Added: trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-start-search-after-selection.html (0 => 120752)
--- trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-start-search-after-selection.html (rev 0)
+++ trunk/LayoutTests/platform/chromium/editing/text-iterator/findString-start-search-after-selection.html 2012-06-19 21:12:46 UTC (rev 120752)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src="" language="_javascript_" type="text/_javascript_"></script>
+<title>Testing that searching for text starts at the active selection</title>
+</head>
+<body>
+ <div id="container">
+ The _before_selection_ word is before the selection, so we shouldn't be able to find it if span_to_select is selected.
+ <br/>
+ <span id="span_to_select">The _in_selection_ word is in the selection and we should always be able to find it.</span>
+ <br/>
+ The _after_selection_ word is after the selection and we should always be able to find that too.
+ </div>
+<pre id="console" style="visibility: hidden;"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
+}
+
+function selectText()
+{
+ var selection = window.getSelection();
+ var range = document.createRange();
+ var spanToSelect = document.getElementById('span_to_select');
+ range.setStartBefore(spanToSelect);
+ range.setEndAfter(spanToSelect);
+ selection.addRange(range);
+}
+
+if (!window.testRunner)
+ testFailed('This test requires the testRunner object');
+else {
+ shouldBeTrue('testRunner.findString("_before_selection_", [])');
+ shouldBeTrue('testRunner.findString("_in_selection_", [])');
+ shouldBeTrue('testRunner.findString("_after_selection_", [])');
+
+ debug('Selecting some text. This should make it not possible to find the _before_selection_ word without enabling wrap-around.');
+ selectText();
+
+ shouldBeFalse('testRunner.findString("_before_selection_", [])');
+ shouldBeTrue('testRunner.findString("_in_selection_", [])');
+ shouldBeTrue('testRunner.findString("_after_selection_", [])');
+}
+
+document.getElementById("console").style.removeProperty("visibility");
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes