Chromium Code Reviews| 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..ae16cb0cded451da093c7db1e5b51bd748390c72 100644 |
| --- a/LayoutTests/editing/spelling/design-mode-spellcheck-off.html |
| +++ b/LayoutTests/editing/spelling/design-mode-spellcheck-off.html |
| @@ -1,39 +1,39 @@ |
| <!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'); |
| - 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); |
| +}); |
| - var x = document.body.offsetLeft + 10; |
| - var y = document.body.offsetTop + 10; |
| - 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')); |
| +var x = document.body.offsetLeft + 30; |
|
groby-ooo-7-16
2013/10/24 16:47:49
Curious - why the offset changes?
grzegorz
2013/10/25 09:41:08
Chrome's "Inspect Element" shows that description(
|
| +var y = document.body.offsetTop + 30; |
| +eventSender.mouseMoveTo(x, y); |
| +eventSender.mouseDown(); |
| +eventSender.mouseUp(); |
| </script> |
| +<script src="../../fast/js/resources/js-test-post.js"></script> |
| </body> |
| </html> |