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

Side by Side Diff: LayoutTests/editing/spelling/grammar.html

Issue 39733005: Use asynchronous spellcheck path in layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 2 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 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../fast/js/resources/js-test-pre.js"></script>
3 4
4 <style> 5 <style>
5 .editing { 6 .editing {
6 border: 2px solid red; 7 border: 2px solid red;
7 padding: 12px; 8 padding: 12px;
8 font-size: 24px; 9 font-size: 24px;
9 } 10 }
10 </style> 11 </style>
11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > 12 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script >
12 13
13 <script> 14 <script>
14 function log(msg) {
15 document.getElementById("console").innerHTML += (msg + "\n");
16 }
17
18 function editingTest() { 15 function editingTest() {
19 if (window.testRunner) 16 if (window.testRunner)
20 testRunner.dumpAsText(); 17 testRunner.dumpAsText();
21 18
22 document.getElementById("root").focus(); 19 document.getElementById("root").focus();
23
24 document.execCommand("InsertText", false, "I have a issue."); 20 document.execCommand("InsertText", false, "I have a issue.");
25 21
26 if (window.testRunner) { 22 shouldBecomeEqual('internals.hasGrammarMarker(document, 7, 1)', 'true', func tion() {
27 if (internals.hasGrammarMarker(document, 7, 1))
28 log("PASS");
29 else
30 log("FAIL");
31 document.getElementById("root").style.display = "none"; 23 document.getElementById("root").style.display = "none";
32 } 24 finishJSTest();
25 });
33 } 26 }
34 27
35 </script> 28 </script>
36 29
37 <title>Editing Test</title> 30 <title>Editing Test</title>
38 </head> 31 </head>
39 <body> 32 <body>
40 <div>You should see the text 'I have a issue'. 'a' should have a grammar suggest ion marking.</div> 33 <div contenteditable id="root" class="editing"></div>
41 <div contenteditable id="root" class="editing">
42 </div>
43 <pre id="console"></pre>
44 <script> 34 <script>
35 description("This tests whether the grammatically-incorrect phrase "
36 + "'I have a issue' has grammar marker on 'a'.");
37
38 jsTestIsAsync = true;
39
40 if (window.internals) {
41 internals.settings.setUnifiedTextCheckerEnabled(true);
42 internals.settings.setAsynchronousSpellCheckingEnabled(true);
43 }
44
45 editingTest(); 45 editingTest();
46 </script> 46 </script>
47 47 <script src="../../fast/js/resources/js-test-post.js"></script>
48 </body> 48 </body>
49 </html> 49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698