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

Side by Side Diff: LayoutTests/editing/spelling/design-mode-spellcheck-off.html

Issue 39733005: Use asynchronous spellcheck path in layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Apply groby's suggestions Created 7 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body spellcheck="false"> 3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body spellcheck="false">
4 asdf is misspelled. 7 asdf is misspelled.
5 <p>To test this manually, click "asdf" above. There should be no spelling marker for "asdf" after the click.</p>
6 <script> 8 <script>
9 description("This tests whether WebKit does not spell check in 'designMode' "
10 + "when spellcheck='false'. To test manually, click 'asdf' above. "
11 + "There should be no spelling marker for 'asdf' after the click.");
7 12
8 if (window.testRunner) 13 jsTestIsAsync = true;
9 testRunner.dumpAsText(); 14
15 if (window.internals) {
16 internals.settings.setUnifiedTextCheckerEnabled(true);
17 internals.settings.setAsynchronousSpellCheckingEnabled(true);
18 }
10 19
11 document.designMode = "on"; 20 document.designMode = "on";
12 21
13 if (document.activeElement != document.body) 22 document.body.addEventListener('mousedown', function() {
14 document.body.appendChild(document.createTextNode('FAIL: active element befo re click is not body element')); 23 if (document.activeElement != document.body) {
15 else if (window.testRunner && window.eventSender) { 24 testFailed('Active element after click is not body element');
16 testRunner.waitUntilDone(); 25 finishJSTest();
26 }
17 27
18 document.body.addEventListener('mousedown', function() { 28 if (window.internals)
19 if (document.activeElement != document.body) 29 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 4)', 'false' , finishJSTest);
20 document.body.appendChild(document.createTextNode('FAIL: active elem ent after click is not body element')); 30 });
21 else if (internals.hasSpellingMarker(document, 0, 4))
22 document.body.appendChild(document.createTextNode('FAIL: spell check was invoked'));
23 else
24 document.body.appendChild(document.createTextNode('PASS'));
25 testRunner.notifyDone();
26 });
27 31
32 if (window.eventSender) {
28 var x = document.body.offsetLeft + 10; 33 var x = document.body.offsetLeft + 10;
29 var y = document.body.offsetTop + 10; 34 var y = document.body.offsetTop + 17;
30 eventSender.mouseMoveTo(x, y); 35 eventSender.mouseMoveTo(x, y);
31 eventSender.mouseDown(); 36 eventSender.mouseDown();
32 eventSender.mouseUp(); 37 eventSender.mouseUp();
33 setTimeout("testRunner.notifyDone();document.body.appendChild(document.creat eTextNode('FAIL: timeout'));", 500); 38 }
34 } else
35 document.body.appendChild(document.createTextNode('PASS'));
36 39
37 </script> 40 </script>
41 <script src="../../fast/js/resources/js-test-post.js"></script>
38 </body> 42 </body>
39 </html> 43 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698