Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / text-iterator / findString-restarts-at-last-position.html
blob0d7eff5e9663d585f012d19cdb815f216ff8b17d
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src=../../resources/js-test.js language="javascript" type="text/javascript"></script>
5 <title>Testing that searching for text restarts at the last active match.</title>
6 </head>
7 <body>
8 <div id="container">
9 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 />
10 Start: The first search should match this word: first_step.<br />
11 Success: The second search should match this word: last_step. Subsequent searches should fail.
12 </div>
13 <pre id="console" style="visibility: hidden;"></pre>
14 <script>
15 function log(message)
17 document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
20 if (!window.testRunner)
21 testFailed('This test requires the testRunner object');
22 else {
23 shouldBeTrue('testRunner.findString("first_", [])');
24 shouldBeTrue('testRunner.findString("first_step", ["StartInSelection"])');
25 shouldBeTrue('testRunner.findString("last_step", [])');
26 shouldBeFalse('testRunner.findString("last_step", [])');
27 shouldBeTrue('testRunner.findString("last_step", ["WrapAround"])');
30 document.getElementById("console").style.removeProperty("visibility");
32 var successfullyParsed = true;
33 </script>
34 </body>
35 </html>