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

Side by Side Diff: LayoutTests/editing/spelling/spellcheck-disable-enable.html

Issue 21130005: Trigger spell check/remove markers if spell checker gets enabled/disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="container">
8 <div id="destination" contentEditable></div>
9 </div>
10
11 <script>
12
13 description("Spell check markers should be removed when disabling spell checker but " +
14 " they should be restored if spell checker gets enabled and an editable is focus ed.");
15
16 internals.settings.setAsynchronousSpellCheckingEnabled(false);
abarth-chromium 2013/07/31 00:42:14 Usually we check whether window.internals is avail
17
18 function waitForMarkersToAppear(node, nretry)
19 {
20 if (nretry && !internals.markerCountForNode(node, "spelling")) {
21 window.setTimeout(function() { waitForMarkersToAppear(node, nretry - 1); }, 0);
22 }
23 }
24
25 var destination = document.getElementById("destination");
26 destination.focus();
27 document.execCommand("InsertText", false, "zz.");
28 var node = destination.childNodes[0];
29 waitForMarkersToAppear(node, 10);
30 shouldBe('internals.markerCountForNode(node, "spelling")', '1');
31 internals.setContinuousSpellCheckingEnabled(false);
32 shouldBe('internals.markerCountForNode(node, "spelling")', '0');
33 internals.setContinuousSpellCheckingEnabled(true);
34 waitForMarkersToAppear(node, 10);
35 shouldBe('internals.markerCountForNode(node, "spelling")', '1');
36
37 </script>
38 <script src="../../fast/js/resources/js-test-post.js"></script>
39 </body>
40 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/spellcheck-disable-enable-expected.txt » ('j') | Source/web/EditorClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698