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

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

Issue 2442313002: Convert editing/spelling/design-mode-spellcheck-off.html with spellcheck_test (Closed)
Patch Set: Wed Oct 26 17:56:37 JST 2016 Created 4 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 | third_party/WebKit/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: third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html b/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
index d63c5e52fd83f811bc749797874cc1f92df4921c..83bce2cc635616a942267aafca31747da7a1521d 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
@@ -1,46 +1,38 @@
<!DOCTYPE html>
-<html>
-<body spellcheck="false">
-<script src="../editing.js"></script>
-<script src="../../resources/js-test.js"></script>
-<div id="misspelled" onmouseup="checkSpellingMarker()">asd is misspelled.</div>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script src="spellcheck_test.js"></script>
<script>
-description("This tests whether WebKit does not spell check in 'designMode' "
- + "when spellcheck='false'. To test manually, click 'asd' and move cursor until '.'. "
- + "There should be no spelling marker for 'asd'.");
-
-jsTestIsAsync = true;
-if (window.testRunner)
- testRunner.setMockSpellCheckerEnabled(true);
-
-document.designMode = "on";
-
-function checkSpellingMarker()
-{
- if (!window.internals)
- return;
-
- // 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);
+spellcheck_test(
+ [
+ '<div id="container" spellcheck="false">',
+ '<div>|asd is misspelled.</div>',
+ '</div>'
+ ].join(''),
+ document => {
+ document.designMode = 'on';
+ document.getSelection().modify('move', 'forward', 'word');
+ },
+ [
+ '<div id="container" spellcheck="false">',
+ '<div>asd is misspelled.</div>',
+ '</div>'
+ ].join(''),
+ {
+ title: 'No spelling marker in designMode when spellcheck=false.',
+ callback: sample => spellcheck_test(
+ sample,
+ document => {
+ document.getElementById('container').setAttribute('spellcheck', 'true');
+ // Do any selection change to force spellchecking after attribute change.
+ document.getSelection().modify('move', 'forward', 'line');
+ },
+ [
+ '<div id="container" spellcheck="true">',
+ '<div>_asd_ is misspelled.</div>',
+ '</div>'
+ ].join(''),
+ 'Spelling marker appears when changing spellcheck from false to true.')
});
-}
-
-if (window.eventSender) {
- var misspelledDiv = document.getElementById("misspelled");
- var x = misspelledDiv.offsetLeft;
- var y = misspelledDiv.offsetTop;
- eventSender.mouseMoveTo(x, y);
- eventSender.mouseDown();
- eventSender.mouseUp();
-}
-</script>
-</body>
-</html>
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698