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

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: verify 'asd' (not 'asdf') since MockSpellCheck::misspelledWords[] contatins it 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..a1bd409ed0623f0a76167a6f569c36931471ff89 100644
--- a/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
+++ b/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
@@ -1,14 +1,13 @@
<!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()">asd is misspelled.</div>
<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.");
+ + "when spellcheck='false'. To test manually, click 'asd' and move cursor until '.'. "
+ + "There should be no spelling marker for 'asd'.");
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 "asd" has been typed/changed
+ // to give a chance to spellcheck.
+ moveSelectionForwardByWordCommand();
+
+ shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 3)', 'false', function() {
+ evalAndLog('document.body.setAttribute("spellcheck", "true")');
+ // Do any selection change to force spellchecking after attribute change.
+ moveSelectionForwardByLineCommand();
+ shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 3)', '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