| Index: third_party/WebKit/LayoutTests/editing/spelling/spelling-insert-newline-between-multi-word-misspelling.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spelling-insert-newline-between-multi-word-misspelling.html b/third_party/WebKit/LayoutTests/editing/spelling/spelling-insert-newline-between-multi-word-misspelling.html
|
| index 0bf09369688e4a1afa70a07ae87714839f25fa4e..526b841868c24ef2227a9854724d229be500c472 100644
|
| --- a/third_party/WebKit/LayoutTests/editing/spelling/spelling-insert-newline-between-multi-word-misspelling.html
|
| +++ b/third_party/WebKit/LayoutTests/editing/spelling/spelling-insert-newline-between-multi-word-misspelling.html
|
| @@ -1,58 +1,20 @@
|
| -<!DOCTYPE html>
|
| -<html>
|
| -<head>
|
| -<script src="../../resources/js-test.js"></script>
|
| -<script src="resources/util.js"></script>
|
| -</head>
|
| -<body>
|
| -<div id="container">
|
| - <div id="destination" contentEditable></div>
|
| -</div>
|
| -<script>
|
| -
|
| -description("Spelling should work when the user inserts a newline between a multi word misspelling. " +
|
| - "To test manually, enable 'Ask Google for Suggestions' in Chrome, type 'It should be upper \ncase.'." +
|
| - "The test succeeds if there are no spelling markers under 'upper \ncase'.");
|
| -
|
| -function waitForMarkersToDisappear(firstNode, secondNode, numberOfTries)
|
| -{
|
| - firstMarkerRange = internals.markerRangeForNode(firstNode, "spelling", 0);
|
| - secondMarkerRange = internals.markerRangeForNode(secondNode, "spelling", 0);
|
| -
|
| - if ((firstMarkerRange || secondMarkerRange) && numberOfTries > 0) {
|
| -
|
| - window.setTimeout(function() {
|
| - waitForMarkersToDisappear(firstNode, secondNode, numberOfTries - 1);
|
| - }, 0);
|
| -
|
| - return;
|
| - }
|
| -
|
| - shouldBeNull("firstMarkerRange");
|
| - shouldBeNull("secondMarkerRange");
|
| -
|
| - finishJSTest();
|
| -};
|
| +<!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>
|
|
|
| -initSpellTest("destination", "It should be upper case.", function(textNode) {
|
| -
|
| - spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
|
| - shouldBeEqualToString("spellingMarkerRange.toString()", "upper case");
|
| -
|
| - for(var i = 0; i < 5; ++i)
|
| - eventSender.keyDown("ArrowLeft");
|
| -
|
| - document.execCommand("InsertText", false, "\n");
|
| -
|
| - var destinationChildNodes =
|
| - document.getElementById("destination").childNodes;
|
| -
|
| - var firstLine = destinationChildNodes[0];
|
| - var secondLine = destinationChildNodes[1].firstChild;
|
| -
|
| - waitForMarkersToDisappear(firstLine, secondLine, 10);
|
| -
|
| -}, true);
|
| +<script>
|
| +spellcheck_test(
|
| + '<div contenteditable>It should be upper |case.</div>',
|
| + '',
|
| + '<div contenteditable>It should be #upper case#.</div>',
|
| + {
|
| + title: 'Has marker on initial multi-word misspelling.',
|
| + callback: sample => spellcheck_test(
|
| + sample,
|
| + document => document.execCommand('insertText', false, '\n'),
|
| + '<div contenteditable>It should be upper <div>case.</div></div>',
|
| + 'Marker disappears after inserting newline in multi-word misspelling.')
|
| + });
|
| </script>
|
| -</body>
|
| -</html>
|
|
|