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(document.getElementById('destination'), document.getElementBy
Id('frame').contentWindow.document);"> | 6 <body onload="test(document.getElementById('destination'), document.getElementBy
Id('frame').contentWindow.document);"> |
7 <pre id="console"></pre> | 7 <pre id="console"></pre> |
8 <div id="container"> | 8 <div id="container"> |
9 <div id="destination" contentEditable></div> | 9 <div id="destination" contentEditable></div> |
10 <iframe id="frame" src="data:text/html,<body contenteditable></body>"></iframe
> | 10 <iframe id="frame" src="data:text/html,<body contenteditable></body>"></iframe
> |
(...skipping 12 matching lines...) Expand all Loading... |
23 var destination_elm_in_frame = null; | 23 var destination_elm_in_frame = null; |
24 | 24 |
25 function test(destination, frame_doc) | 25 function test(destination, frame_doc) |
26 { | 26 { |
27 if (!window.internals) | 27 if (!window.internals) |
28 { | 28 { |
29 document.getElementById("console").innerHTML = "Automatic testing imposs
ible. Test manually.\n"; | 29 document.getElementById("console").innerHTML = "Automatic testing imposs
ible. Test manually.\n"; |
30 return; | 30 return; |
31 } | 31 } |
32 | 32 |
33 internals.settings.setAsynchronousSpellCheckingEnabled(true); | 33 internals.settings.setAsynchronousSpellCheckingEnabled(false); |
34 internals.settings.setUnifiedTextCheckerEnabled(true); | 34 internals.settings.setUnifiedTextCheckerEnabled(true); |
35 | 35 |
36 function waitForMarkersToAppear(node, nretry) | |
37 { | |
38 if (nretry > 0 && !internals.markerCountForNode(node, "spelling")) { | |
39 window.setTimeout(function() { waitForMarkersToAppear(node, nretry -
1); }, 1); | |
40 } | |
41 } | |
42 | |
43 destination_elm = destination; | 36 destination_elm = destination; |
44 destination_elm_in_frame = frame_doc.body; | 37 destination_elm_in_frame = frame_doc.body; |
45 destination_elm.focus(); | 38 destination_elm.focus(); |
46 document.execCommand("InsertText", false, "zz."); | 39 document.execCommand("InsertText", false, "zz."); |
47 waitForMarkersToAppear(destination_elm.childNodes[0], 10); | |
48 shouldBe('internals.markerCountForNode(destination_elm.childNodes[0], "spell
ing")', '1'); | 40 shouldBe('internals.markerCountForNode(destination_elm.childNodes[0], "spell
ing")', '1'); |
49 destination_elm_in_frame.focus(); | 41 destination_elm_in_frame.focus(); |
50 frame_doc.execCommand("InsertText", false, "zz."); | 42 frame_doc.execCommand("InsertText", false, "zz."); |
51 waitForMarkersToAppear(destination_elm_in_frame.childNodes[0], 10); | |
52 shouldBe('internals.markerCountForNode(destination_elm_in_frame.childNodes[0
], "spelling")', '1'); | 43 shouldBe('internals.markerCountForNode(destination_elm_in_frame.childNodes[0
], "spelling")', '1'); |
53 internals.setContinuousSpellCheckingEnabled(false); | 44 internals.setContinuousSpellCheckingEnabled(false); |
54 shouldBe('internals.markerCountForNode(destination_elm.childNodes[0], "spell
ing")', '0'); | 45 shouldBe('internals.markerCountForNode(destination_elm.childNodes[0], "spell
ing")', '0'); |
55 shouldBe('internals.markerCountForNode(destination_elm_in_frame.childNodes[0
], "spelling")', '0'); | 46 shouldBe('internals.markerCountForNode(destination_elm_in_frame.childNodes[0
], "spelling")', '0'); |
56 destination_elm.focus(); | 47 destination_elm.focus(); |
57 internals.setContinuousSpellCheckingEnabled(true); | 48 internals.setContinuousSpellCheckingEnabled(true); |
58 waitForMarkersToAppear(destination_elm.childNodes[0], 10); | |
59 shouldBe('internals.markerCountForNode(destination_elm.childNodes[0], "spell
ing")', '1'); | 49 shouldBe('internals.markerCountForNode(destination_elm.childNodes[0], "spell
ing")', '1'); |
60 | 50 |
61 finishJSTest(); | 51 finishJSTest(); |
62 } | 52 } |
63 | 53 |
64 </script> | 54 </script> |
65 <script src="../../fast/js/resources/js-test-post.js"></script> | 55 <script src="../../fast/js/resources/js-test-post.js"></script> |
66 </body> | 56 </body> |
67 </html> | 57 </html> |
OLD | NEW |