Editing tests should use testRunner instead of layoutTestController
[WebKit-https.git] / LayoutTests / editing / deleting / delete-ligature-003.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2     <head>
3         <script src="../editing.js" language="javascript" type="text/javascript" ></script>
4         <script language="javascript" type="text/javascript">
5         function log(str) {
6             var li = document.createElement("li");
7             li.appendChild(document.createTextNode(str));
8             var console = document.getElementById("console");
9             console.appendChild(li);
10         }
11         function sendBackwardDeleteKey() {
12             if (window.eventSender)
13                 eventSender.keyDown(String.fromCharCode(0x0008), null);
14         }
15         function runTestOn(platform) {
16             var testarea = document.getElementById("test");
17             if (window.internals)
18                 internals.settings.setEditingBehavior(platform);
19
20             testarea.focus();
21             moveSelectionForwardByCharacterCommand();
22             moveSelectionForwardByCharacterCommand();
23             sendBackwardDeleteKey();
24             execUndoCommand();
25             if (testarea.textContent == "\u0E27\u0E31")
26                 log("Succeeded for " + platform);
27             else
28                 log("Failed. Actual: \"" + testarea.value + "\", Expected: \"\u0E27\u0E31\"");
29         }
30         function editingTest() {
31             if (window.testRunner)
32                 testRunner.dumpAsText();
33             runTestOn("mac");
34             runTestOn("win");
35             runTestOn("unix");
36         }
37         </script>
38         <title>Editing Test (Undo deleting a ligature)</title> 
39     </head> 
40     <body>
41         <p>This test tests whether the undo command works when the BackSpace key deletes the last character of a ligature "&#x0E27;&#x0E31;".</p>
42         <p>If this test succeeds, you can see "&#x0E27;&#x0E31;" (U+0E27,U+0E31) and a string "succeeded" for each platform below.</p>
43         <div id="test" contenteditable>&#x0E27;&#x0E31;</div>
44         <ul id="console"></ul>
45         <script language="javascript" type="text/javascript">
46         runEditingTest();
47         </script>
48     </body>
49 </html>