blob: 6264c55d5de15baa9cb050956f62cecbb8e03225 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<div id="container">
<div id="destination" contentEditable></div>
</div>
<script>
function verify(nretry)
{
if (!nretry) {
finishJSTest()
return;
}
var texts = destination.childNodes;
markedText = null;
for (var i = 0; i < texts.length; ++i) {
if (internals.markerCountForNode(texts[i], "spelling")) {
markedText = internals.markerRangeForNode(texts[i], "spelling", 0).toString();
markerDescription = internals.markerDescriptionForNode(texts[i], "spelling", 0);
break;
}
}
if (markedText != null) {
shouldBeEqualToString("markedText", "wellcome");
shouldBeEqualToString("markerDescription", "welcome");
finishJSTest();
}
// Wait until the async spellchecking is done.
window.setTimeout(function() { verify(nretry - 1); }, 0);
}
function test()
{
jsTestIsAsync = true;
internals.settings.setUnifiedTextCheckerEnabled(true);
internals.settings.setAsynchronousSpellCheckingEnabled(true);
var sel = window.getSelection();
var destination = document.getElementById("destination");
destination.focus();
document.execCommand("InsertHTML", false, "wellcome");
document.execCommand("InsertText", false, ".");
window.setTimeout(function() { verify(10); }, 0);
}
description("The spellchecker should store replacement text in each marker.");
if (window.internals)
test();
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>