OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
| 3 <script src="../../fast/js/resources/js-test-pre.js"></script> |
3 | 4 |
4 <style> | 5 <style> |
5 .editing { | 6 .editing { |
6 border: 2px solid red; | 7 border: 2px solid red; |
7 padding: 12px; | 8 padding: 12px; |
8 font-size: 24px; | 9 font-size: 24px; |
9 } | 10 } |
10 </style> | 11 </style> |
11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script
> | 12 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script
> |
12 | 13 |
13 <script> | 14 <script> |
14 function log(msg) { | |
15 document.getElementById("console").innerHTML += (msg + "\n"); | |
16 } | |
17 | |
18 function editingTest() { | 15 function editingTest() { |
19 if (window.testRunner) | 16 if (window.testRunner) |
20 testRunner.dumpAsText(); | 17 testRunner.dumpAsText(); |
21 | 18 |
22 document.getElementById("root").focus(); | 19 document.getElementById("root").focus(); |
23 | |
24 document.execCommand("InsertText", false, "I have a issue."); | 20 document.execCommand("InsertText", false, "I have a issue."); |
25 | 21 |
26 if (window.testRunner) { | 22 if (window.internals) { |
27 if (internals.hasGrammarMarker(document, 7, 1)) | 23 shouldBecomeEqual('internals.hasGrammarMarker(document, 7, 1)', 'true',
function() { |
28 log("PASS"); | 24 document.getElementById("root").style.display = "none"; |
29 else | 25 finishJSTest(); |
30 log("FAIL"); | 26 }); |
31 document.getElementById("root").style.display = "none"; | |
32 } | 27 } |
33 } | 28 } |
34 | 29 |
35 </script> | 30 </script> |
36 | 31 |
37 <title>Editing Test</title> | 32 <title>Editing Test</title> |
38 </head> | 33 </head> |
39 <body> | 34 <body> |
40 <div>You should see the text 'I have a issue'. 'a' should have a grammar suggest
ion marking.</div> | 35 <div contenteditable id="root" class="editing"></div> |
41 <div contenteditable id="root" class="editing"> | |
42 </div> | |
43 <pre id="console"></pre> | |
44 <script> | 36 <script> |
| 37 description("This tests whether the grammatically-incorrect phrase " |
| 38 + "'I have a issue' has grammar marker on 'a'."); |
| 39 |
| 40 jsTestIsAsync = true; |
| 41 |
| 42 if (window.internals) { |
| 43 internals.settings.setUnifiedTextCheckerEnabled(true); |
| 44 internals.settings.setAsynchronousSpellCheckingEnabled(true); |
| 45 } |
| 46 |
45 editingTest(); | 47 editingTest(); |
46 </script> | 48 </script> |
47 | 49 <script src="../../fast/js/resources/js-test-post.js"></script> |
48 </body> | 50 </body> |
49 </html> | 51 </html> |
OLD | NEW |