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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak.html

Issue 2450373003: Convert editing/spelling/spelling-linebreak.html with spellcheck_test (Closed)
Patch Set: switch marker 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/spelling-linebreak-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/spelling-linebreak.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak.html b/third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak.html
index d0b47414aff91f14a107c645a550d43d90385f60..61b8d3d2e4ffc1cdf9f29469079baa52772f333b 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak.html
@@ -1,64 +1,20 @@
-<html>
-<head>
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script src="spellcheck_test.js"></script>
-<style>
-.editing {
- border: 2px solid red;
- padding: 12px;
- font-size: 24px;
-}
-</style>
-<script src="../../resources/js-test.js"></script>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-
-jsTestIsAsync = true;
-if (window.testRunner)
- testRunner.setMockSpellCheckerEnabled(true);
-
-function editingTest() {
-
- var elem = document.getElementById("test");
- var selection = window.getSelection();
- selection.collapse(elem, elem.childNodes.length);
-
- typeCharacterCommand('z');
- typeCharacterCommand('z');
- typeCharacterCommand(' ');
- typeCharacterCommand('a');
- typeCharacterCommand(' ');
- typeCharacterCommand('a');
- moveSelectionBackwardByWordCommand();
- insertLineBreakCommand();
-
- if (window.testRunner) {
- selection.collapse(elem, 0);
- shouldBecomeEqual("internals.hasSpellingMarker(document, 6, 2)", "true", function() {
- document.getElementById("root").style.display = "none";
- finishJSTest();
- });
- }
-
-}
-
-</script>
-
-<title>Editing Test</title>
-</head>
-<body>
-<script>
-description("Misspellings should be preserved when a line-break command "
- + "splits a text node. You should see 'Hello,zz a' on the first line below, "
- + "and 'a' on the second line. "
- + "This test succeeds when 'zz' (and only 'zz') is marked as misspelled.");
-</script>
-<div contenteditable id="root" class="editing">
-<!-- we need to lead "Hello," to preserve the marker even after collapse() -->
-<span id="test">Hello,</span>
-</div>
<script>
-editingTest();
+spellcheck_test(
+ '<div contenteditable>Hello,zz a |a</div>',
+ '',
+ '<div contenteditable>Hello,#zz# a a</div>',
+ {
+ title: 'Has marker on initially misspelled word',
+ callback: sample => spellcheck_test(
+ sample,
+ 'insertLineBreak',
+ '<div contenteditable>Hello,#zz# a <br>a</div>',
+ 'Markers are preserved after adding line break')
+ });
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698