OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body onload="test();"> | 6 <body onload="test();"> |
7 <div id="console"></div> | 7 <div id="console"></div> |
8 <div id="editable" contenteditable></div> | 8 <div id="editable" contenteditable></div> |
9 | 9 |
10 <script> | 10 <script> |
11 description("Text to check is divided into chunks to make sure checking some hug
e text " + | 11 description("Text to check is divided into chunks to make sure checking some hug
e text " + |
12 "does not freeze the page/UI. With the asynchronous spell checker the whole text
is checked. " + | 12 "does not freeze the page/UI. With the asynchronous spell checker the whole text
is checked. " + |
13 "To test manaully trigger spell checking of the editable (e.g. by copy+paste) wi
th unified " + | 13 "To test manaully trigger spell checking of the editable (e.g. by copy+paste) wi
th unified " + |
14 "and asynchronous checker on. There should be 6 misspellings marked."); | 14 "and asynchronous checker on. There should be 6 misspellings marked."); |
15 | 15 |
16 jsTestIsAsync = true; | 16 jsTestIsAsync = true; |
| 17 if (window.testRunner) |
| 18 testRunner.setMockSpellCheckerEnabled(true); |
17 | 19 |
18 var testEditable = null; | 20 var testEditable = null; |
19 | 21 |
20 function test() | 22 function test() |
21 { | 23 { |
22 testEditable = document.getElementById("editable"); | 24 testEditable = document.getElementById("editable"); |
23 var loopCount = 150; | 25 var loopCount = 150; |
24 var longText = "Good good good good good good good good good good good good
good. " + | 26 var longText = "Good good good good good good good good good good good good
good. " + |
25 "Good good good good good good good good good good good good good. " + | 27 "Good good good good good good good good good good good good good. " + |
26 "Good good good good good good good good good good good good good. " + | 28 "Good good good good good good good good good good good good good. " + |
(...skipping 15 matching lines...) Expand all Loading... |
42 testEditable.focus(); | 44 testEditable.focus(); |
43 internals.setSpellCheckingEnabled(true); | 45 internals.setSpellCheckingEnabled(true); |
44 shouldBecomeEqual('internals.markerCountForNode(testEditable.childNodes[0],
"spelling")', '6', function() { | 46 shouldBecomeEqual('internals.markerCountForNode(testEditable.childNodes[0],
"spelling")', '6', function() { |
45 testEditable.removeChild(testEditable.childNodes[0]); | 47 testEditable.removeChild(testEditable.childNodes[0]); |
46 finishJSTest(); | 48 finishJSTest(); |
47 }, 5000 /* huge text needs more time to be spell checked */); | 49 }, 5000 /* huge text needs more time to be spell checked */); |
48 } | 50 } |
49 </script> | 51 </script> |
50 </body> | 52 </body> |
51 </html> | 53 </html> |
OLD | NEW |