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> |