Editing tests should use testRunner instead of layoutTestController
[WebKit-https.git] / LayoutTests / editing / selection / 5195166-2.html
1 <p>This tests for a bug where selection change notifications would post the wrong proposed selected range.</p>
2 <div id="div" contenteditable="true">There should be five characters selected in this sentence.</div>
3 <ul id="console"></ul>
4 <script>
5 function log(str) {
6     console = document.getElementById("console");
7     li = document.createElement("li");
8     text = document.createTextNode(str);
9     console.appendChild(li);
10     li.appendChild(text);
11 }
12 if (window.testRunner) {
13     window.testRunner.dumpEditingCallbacks();
14     var text = document.getElementById("div").firstChild;
15     var selection = window.getSelection();
16     selection.setBaseAndExtent(text, 0, text, 0);
17     testRunner.execCommand("MoveForwardAndModifySelection");
18     testRunner.execCommand("MoveForwardAndModifySelection");
19     testRunner.execCommand("MoveForwardAndModifySelection");
20     testRunner.execCommand("MoveBackwardAndModifySelection");
21 } else {
22     log("Failure: This test cannot be run manually.")
23 }
24
25 </script>