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

Unified 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, 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/spelling/design-mode-spellcheck-off.html
diff --git a/LayoutTests/editing/spelling/design-mode-spellcheck-off.html b/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
index 34e1f6e75b4b54a85ea86cb0d7ce7df7b380fdac..b8256a1a74bda061f45897934b544ee25560936a 100644
--- a/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
+++ b/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
@@ -1,39 +1,43 @@
<!DOCTYPE html>
<html>
-<body spellcheck="false">
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body spellcheck="false">
asdf is misspelled.
-<p>To test this manually, click "asdf" above. There should be no spelling marker for "asdf" after the click.</p>
<script>
+description("This tests whether WebKit does not spell check in 'designMode' "
+ + "when spellcheck='false'. To test manually, click 'asdf' above. "
+ + "There should be no spelling marker for 'asdf' after the click.");
-if (window.testRunner)
- testRunner.dumpAsText();
+jsTestIsAsync = true;
+
+if (window.internals) {
+ internals.settings.setUnifiedTextCheckerEnabled(true);
+ internals.settings.setAsynchronousSpellCheckingEnabled(true);
+}
document.designMode = "on";
-if (document.activeElement != document.body)
- document.body.appendChild(document.createTextNode('FAIL: active element before click is not body element'));
-else if (window.testRunner && window.eventSender) {
- testRunner.waitUntilDone();
+document.body.addEventListener('mousedown', function() {
+ if (document.activeElement != document.body) {
+ testFailed('Active element after click is not body element');
+ finishJSTest();
+ }
- document.body.addEventListener('mousedown', function() {
- if (document.activeElement != document.body)
- document.body.appendChild(document.createTextNode('FAIL: active element after click is not body element'));
- else if (internals.hasSpellingMarker(document, 0, 4))
- document.body.appendChild(document.createTextNode('FAIL: spell check was invoked'));
- else
- document.body.appendChild(document.createTextNode('PASS'));
- testRunner.notifyDone();
- });
+ if (window.internals)
+ shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 4)', 'false', finishJSTest);
+});
+if (window.eventSender) {
var x = document.body.offsetLeft + 10;
- var y = document.body.offsetTop + 10;
+ var y = document.body.offsetTop + 17;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
- setTimeout("testRunner.notifyDone();document.body.appendChild(document.createTextNode('FAIL: timeout'));", 500);
-} else
- document.body.appendChild(document.createTextNode('PASS'));
+}
</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
« 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