Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / inserting / insert-thai-characters-001.html
blob2b4147af6d5457940f3778682c153d465e0d22ab
1 <html>
2 <head>
3 <title>Editing Test (Inserting a Thai character after a Thai prepend character)</title>
4 <script src="../editing.js" language="javascript" type="text/javascript"></script>
5 <script language="javascript" type="text/javascript">
6 function log(str) {
7 var li = document.createElement("li");
8 li.appendChild(document.createTextNode(str));
9 var console = document.getElementById("console");
10 console.appendChild(li);
12 function editingTest() {
13 if (window.testRunner)
14 testRunner.dumpAsText();
15 var testarea = document.getElementById("test");
16 testarea.focus();
17 typeCharacterCommand(String.fromCharCode(0x0E2D));
18 typeCharacterCommand(String.fromCharCode(0x0E22));
19 typeCharacterCommand(String.fromCharCode(0x0E32));
20 typeCharacterCommand(String.fromCharCode(0x0E01));
21 typeCharacterCommand(String.fromCharCode(0x0E0D));
22 typeCharacterCommand(String.fromCharCode(0x0E35));
23 typeCharacterCommand(String.fromCharCode(0x0E48));
24 typeCharacterCommand(String.fromCharCode(0x0E1B));
25 typeCharacterCommand(String.fromCharCode(0x0E38));
26 typeCharacterCommand(String.fromCharCode(0x0E48));
27 typeCharacterCommand(String.fromCharCode(0x0E19));
28 moveSelectionBackwardByCharacterCommand();
29 moveSelectionBackwardByCharacterCommand();
30 moveSelectionBackwardByCharacterCommand();
31 typeCharacterCommand(String.fromCharCode(0x0E44));
32 typeCharacterCommand(String.fromCharCode(0x0E1B));
33 var expected_result = "\u0E2D\u0E22\u0E32\u0E01\u0E44\u0E1B\u0E0D\u0E35\u0E48\u0E1B\u0E38\u0E48\u0E19";
34 if (testarea.textContent == expected_result)
35 log("Succeeded.");
36 else
37 log("Failed. Actual: \"" + testarea.textContent.value + "\", Expected: \"" + expected_result + "\".");
39 </script>
40 </head>
41 <body>
42 <p>This test tests whether we can insert a Thai character after a Thai "prepend" character.</p>
43 <p>If this test succeeds, you can see a string "succeeded" below.</p>
44 <div contenteditable id="test"></div>
45 <ul id="console"></ul>
46 <script language="javascript" type="text/javascript">
47 runEditingTest();
48 </script>
49 </body>
50 </html>