blob: b7078d312b5ac3f798079dd450b636b582e9ae55 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/util.js"></script>
</head>
<body>
<div id="container">
<div id="destination" contentEditable></div>
</div>
<script>
description("WebKit should not crash after the text has changed and results are served from cache."
+ " To test manually, type 'Spell wellcome. Is it broken?', delete the words 'Is it broken?'."
+ " The test succeeds when WebKit does not crash and 'wellcome' has spelling marker.");
initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) {
// Select the text "Is it broken?".
var deleteRange = document.createRange();
deleteRange.setStart(textNode, 15);
deleteRange.setEnd(textNode, 29);
window.getSelection().removeAllRanges();
window.getSelection().addRange(deleteRange);
shouldBeEqualToString("window.getSelection().toString()", " Is it broken?");
// Del key to delete the text "Is it broken?".
eventSender.keyDown(String.fromCharCode(0x007F), null);
spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
shouldBecomeEqualToString("spellingMarkerRange.toString()", "wellcome", function() {
document.getElementById("destination").innerHTML = "";
finishJSTest();
});
});
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>