Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/spellcheck-editable-on-focus-multiframe.html

Issue 2270293003: Add a switch to TestRunner to enable/disable mock spell checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use in-class initialization Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="resources/util.js"></script> 4 <script src="resources/util.js"></script>
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/js-test.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <pre id="console"></pre> 8 <pre id="console"></pre>
9 <iframe id="frame1" src="data:text/html,<body></body>"></iframe> 9 <iframe id="frame1" src="data:text/html,<body></body>"></iframe>
10 <iframe id="frame2" src="data:text/html,<body></body>"></iframe> 10 <iframe id="frame2" src="data:text/html,<body></body>"></iframe>
11 11
12 <script> 12 <script>
13 13
14 description("Spell checking should be triggered on focus of an editable. " + 14 description("Spell checking should be triggered on focus of an editable. " +
15 "Also after retarting spell checker. It applies to all frames." + 15 "Also after retarting spell checker. It applies to all frames." +
16 "To test manually type focus above editable. Misspellings in them " + 16 "To test manually type focus above editable. Misspellings in them " +
17 "should be marked on focus.Turn spell checker off and on again and again focus e ditables. " + 17 "should be marked on focus.Turn spell checker off and on again and again focus e ditables. " +
18 "Mispelling should be marked again"); 18 "Mispelling should be marked again");
19 19
20 if (window.testRunner)
21 testRunner.setMockSpellCheckerEnabled(true);
22
20 var frame1 = document.getElementById("frame1"); 23 var frame1 = document.getElementById("frame1");
21 var testEditable1 = frame1.contentWindow.document.createElement("div"); 24 var testEditable1 = frame1.contentWindow.document.createElement("div");
22 testEditable1.setAttribute("contentEditable", "true"); 25 testEditable1.setAttribute("contentEditable", "true");
23 frame1.contentWindow.document.body.appendChild(testEditable1); 26 frame1.contentWindow.document.body.appendChild(testEditable1);
24 var frame2 = document.getElementById("frame2"); 27 var frame2 = document.getElementById("frame2");
25 var testEditable2 = frame1.contentWindow.document.createElement("div"); 28 var testEditable2 = frame1.contentWindow.document.createElement("div");
26 testEditable2.setAttribute("contentEditable", "true"); 29 testEditable2.setAttribute("contentEditable", "true");
27 frame2.contentWindow.document.body.appendChild(testEditable2); 30 frame2.contentWindow.document.body.appendChild(testEditable2);
28 testEditable1.innerText = "zz zz zz."; 31 testEditable1.innerText = "zz zz zz.";
29 testEditable2.innerText = "zz zz zz."; 32 testEditable2.innerText = "zz zz zz.";
(...skipping 14 matching lines...) Expand all
44 testEditable1.focus(); 47 testEditable1.focus();
45 testEditable2.focus(); 48 testEditable2.focus();
46 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spellin g")', '3'); 49 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spellin g")', '3');
47 shouldBe('internals.markerCountForNode(testEditable2.childNodes[0], "spellin g")', '3'); 50 shouldBe('internals.markerCountForNode(testEditable2.childNodes[0], "spellin g")', '3');
48 } else { 51 } else {
49 log("Automatic testing impossible. Test manually. See steps in the descripti on."); 52 log("Automatic testing impossible. Test manually. See steps in the descripti on.");
50 } 53 }
51 </script> 54 </script>
52 </body> 55 </body>
53 </html> 56 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698