OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../fast/js/resources/js-test-pre.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; |
| 17 |
16 var testEditable = null; | 18 var testEditable = null; |
17 | 19 |
18 function test() | 20 function test() |
19 { | 21 { |
20 testEditable = document.getElementById("editable"); | 22 testEditable = document.getElementById("editable"); |
21 var loopCount = 150; | 23 var loopCount = 150; |
22 var longText = "Good good good good good good good good good good good good
good. " + | 24 var longText = "Good good good good good good good good good good good good
good. " + |
23 "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. " + |
24 "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. " + |
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."; |
(...skipping 13 matching lines...) Expand all Loading... |
39 internals.settings.setUnifiedTextCheckerEnabled(true); | 41 internals.settings.setUnifiedTextCheckerEnabled(true); |
40 internals.settings.setAsynchronousSpellCheckingEnabled(true); | 42 internals.settings.setAsynchronousSpellCheckingEnabled(true); |
41 | 43 |
42 function waitForMarkersToAppear(node, nretry) | 44 function waitForMarkersToAppear(node, nretry) |
43 { | 45 { |
44 if (nretry > 0 && internals.markerCountForNode(node, "spelling") < 6) { | 46 if (nretry > 0 && internals.markerCountForNode(node, "spelling") < 6) { |
45 window.setTimeout(function() { waitForMarkersToAppear(node, nretry -
1); }, 1); | 47 window.setTimeout(function() { waitForMarkersToAppear(node, nretry -
1); }, 1); |
46 } else { | 48 } else { |
47 shouldBe('internals.markerCountForNode(testEditable.childNodes[0], "
spelling")', '6'); | 49 shouldBe('internals.markerCountForNode(testEditable.childNodes[0], "
spelling")', '6'); |
48 testEditable.removeChild(testEditable.childNodes[0]); | 50 testEditable.removeChild(testEditable.childNodes[0]); |
49 if (window.testRunner) | 51 finishJSTest(); |
50 testRunner.notifyDone(); | |
51 } | 52 } |
52 } | 53 } |
53 | 54 |
54 if (window.testRunner) { | 55 if (window.testRunner) { |
55 testRunner.dumpAsText(); | 56 testRunner.dumpAsText(); |
56 testRunner.waitUntilDone(); | 57 testRunner.waitUntilDone(); |
57 } | 58 } |
58 | 59 |
59 internals.setContinuousSpellCheckingEnabled(false); | 60 internals.setContinuousSpellCheckingEnabled(false); |
60 testEditable.focus(); | 61 testEditable.focus(); |
61 internals.setContinuousSpellCheckingEnabled(true); | 62 internals.setContinuousSpellCheckingEnabled(true); |
62 waitForMarkersToAppear(testEditable.childNodes[0], 10); | 63 waitForMarkersToAppear(testEditable.childNodes[0], 10); |
63 } | 64 } |
64 </script> | 65 </script> |
65 <script src="../../fast/js/resources/js-test-post.js"></script> | 66 <script src="../../fast/js/resources/js-test-post.js"></script> |
66 </body> | 67 </body> |
67 </html> | 68 </html> |
OLD | NEW |