4 <script src=
"../../resources/js-test.js"></script>
5 <script src=
"resources/util.js"></script>
9 <div id=
"destination" contentEditable
></div>
13 description("Spelling should work when the user inserts a newline between a multi word misspelling. " +
14 "To test manually, enable 'Ask Google for Suggestions' in Chrome, type 'It should be upper \ncase.'." +
15 "The test succeeds if there are no spelling markers under 'upper \ncase'.");
17 function waitForMarkersToDisappear(firstNode
, secondNode
, numberOfTries
)
19 firstMarkerRange
= internals
.markerRangeForNode(firstNode
, "spelling", 0);
20 secondMarkerRange
= internals
.markerRangeForNode(secondNode
, "spelling", 0);
22 if ((firstMarkerRange
|| secondMarkerRange
) && numberOfTries
> 0) {
24 window
.setTimeout(function() {
25 waitForMarkersToDisappear(firstNode
, secondNode
, numberOfTries
- 1);
31 shouldBeNull("firstMarkerRange");
32 shouldBeNull("secondMarkerRange");
37 initSpellTest("destination", "It should be upper case.", function(textNode
) {
39 spellingMarkerRange
= internals
.markerRangeForNode(textNode
, "spelling", 0);
40 shouldBeEqualToString("spellingMarkerRange.toString()", "upper case");
42 for(var i
= 0; i
< 5; ++i
)
43 eventSender
.keyDown("leftArrow");
45 document
.execCommand("InsertText", false, "\n");
47 var destinationChildNodes
=
48 document
.getElementById("destination").childNodes
;
50 var firstLine
= destinationChildNodes
[0];
51 var secondLine
= destinationChildNodes
[1].firstChild
;
53 waitForMarkersToDisappear(firstLine
, secondLine
, 10);