Chromium Code Reviews| 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> |