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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/editing/spelling/spellcheck-disable-enable.html
diff --git a/LayoutTests/editing/spelling/spellcheck-disable-enable.html b/LayoutTests/editing/spelling/spellcheck-disable-enable.html
new file mode 100644
index 0000000000000000000000000000000000000000..9036f5cfa15cfad673a2f957fc20b2595f8455cc
--- /dev/null
+++ b/LayoutTests/editing/spelling/spellcheck-disable-enable.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="container">
+ <div id="destination" contentEditable></div>
+</div>
+
+<script>
+
+description("Spell check markers should be removed when disabling spell checker but " +
+" they should be restored if spell checker gets enabled and an editable is focused.");
+
+internals.settings.setAsynchronousSpellCheckingEnabled(false);
abarth-chromium 2013/07/31 00:42:14 Usually we check whether window.internals is avail
+
+function waitForMarkersToAppear(node, nretry)
+{
+ if (nretry && !internals.markerCountForNode(node, "spelling")) {
+ window.setTimeout(function() { waitForMarkersToAppear(node, nretry - 1); }, 0);
+ }
+}
+
+var destination = document.getElementById("destination");
+destination.focus();
+document.execCommand("InsertText", false, "zz.");
+var node = destination.childNodes[0];
+waitForMarkersToAppear(node, 10);
+shouldBe('internals.markerCountForNode(node, "spelling")', '1');
+internals.setContinuousSpellCheckingEnabled(false);
+shouldBe('internals.markerCountForNode(node, "spelling")', '0');
+internals.setContinuousSpellCheckingEnabled(true);
+waitForMarkersToAppear(node, 10);
+shouldBe('internals.markerCountForNode(node, "spelling")', '1');
+
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
« 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