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

Unified Diff: LayoutTests/editing/spelling/design-mode-spellcheck-off.html

Issue 219073002: design-mode-spellcheck-off.html is always passing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 af016234e8d4b28f06ddc4f716d12d0525cac85a..b92e03a96d8d4f0a19983a865096f052f66611e8 100644
--- a/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
+++ b/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
@@ -1,13 +1,12 @@
<!DOCTYPE html>
<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
<body spellcheck="false">
-asdf is misspelled.
+<script src="../editing.js"></script>
+<script src="../../resources/js-test.js"></script>
+<div id="misspelled" onmouseup="checkSpellingMarker()">asdf is misspelled.</div>
<script>
description("This tests whether WebKit does not spell check in 'designMode' "
- + "when spellcheck='false'. To test manually, click 'asdf' above. "
+ + "when spellcheck='false'. To test manually, click arround 'asdf'. "
tony 2014/04/01 16:38:44 Typo of arround?
+ "There should be no spelling marker for 'asdf' after the click.");
jsTestIsAsync = true;
@@ -19,24 +18,32 @@ if (window.internals) {
document.designMode = "on";
-document.body.addEventListener('mousedown', function() {
- if (document.activeElement != document.body) {
- testFailed('Active element after click is not body element');
- finishJSTest();
- }
+function checkSpellingMarker()
+{
+ if (!window.internals)
+ return;
- if (window.internals)
- shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 4)', 'false', finishJSTest);
-});
+ // First, verify spelling with spellcheck attribute off.
+ // Move selection to the next word to notify WebKit that "asdf" has been typed/changed
+ // to give a chance to spellcheck.
+ moveSelectionForwardByWordCommand();
+
+ shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 4)', 'false', function() {
+ evalAndLog('document.body.setAttribute("spellcheck", "true")');
+ // Do any selection change to force spellchecking after attribute change.
+ moveSelectionForwardByLineCommand();
+ shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 4)', 'false', finishJSTest);
+ });
+}
if (window.eventSender) {
- var x = document.body.offsetLeft + 10;
- var y = document.body.offsetTop + 17;
+ var misspelledDiv = document.getElementById("misspelled");
+ var x = misspelledDiv.offsetLeft;
+ var y = misspelledDiv.offsetTop;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
}
-
</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