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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word.html

Issue 2224103003: Convert some spell-checking layout tests to use unified text checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SpellCheckerDebugInfo
Patch Set: add setUnifiedTextCheckerEnabled(true) in util.js Created 4 years, 4 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/delete-misspelled-word-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/delete-misspelled-word.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word.html b/third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word.html
index 60b48aee8c854b989d860c654df6621b7b5731ed..b8a1942331d3a8937fb163866fca862350a24ce9 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word.html
@@ -1,33 +1,36 @@
<!DOCTYPE html>
<html>
<head>
-<script src=../../resources/js-test.js language="javascript" type="text/javascript"></script>
-<title>Testing moving cursor to a misspelled word</title>
-</head>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script src=resources/util.js></script>
+<title>Testing moving cursor to a misspelled word</title>
+</head>
<body>
-<div id="src" contenteditable="true" spellcheck="true"></div><br/>
-<script language="javascript">
-description('Test if Chrome spellchecks a word again when changing a misspelled word.' +
- 'To test manually, type a misspelled word "zz " and type a backspace key twice.' +
- 'This test succeeds when "z" is not marked as misspelled.');
-
-jsTestIsAsync = true;
-
+<div id="src" contenteditable></div>
+<script>
var node = document.getElementById('src');
-node.focus();
-function insertText(text) {
- document.execCommand("InsertText", false, text);
-}
-shouldBeTrue('insertText("z"); insertText("z"); insertText(" "); internals.hasSpellingMarker(document, 0, 2)');
-debug('Enable asynchronous spellchecking, delete two characters, and insert a space');
-internals.settings.setUnifiedTextCheckerEnabled(true);
+var steps = [
+ function() {
+ node.focus();
+ document.execCommand('InsertText', false, 'z');
+ document.execCommand('InsertText', false, 'z');
+ document.execCommand('InsertText', false, ' ');
+ },
+ function() {
+ testRunner.execCommand('DeleteBackward');
+ testRunner.execCommand('DeleteBackward');
+ document.execCommand('InsertText', false, ' ');
+ }
+];
-testRunner.execCommand("DeleteBackward");
-testRunner.execCommand("DeleteBackward");
-document.execCommand("InsertText", false, ' ');
+var assertions = [
+ () => assert_true(internals.hasSpellingMarker(document, 0, 2)),
+ () => assert_false(internals.hasSpellingMarker(document, 0, 1))
+];
-shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 1)', 'false', finishJSTest);
+runSpellingTest(steps, assertions, 'Blink spellchecks a word again when changing a misspelled word');
</script>
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/delete-misspelled-word-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698