blob: ddc0505ee7a101df65cc62d5dcade25995f15ff5 [file] [edit]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/dump-as-markup.js"></script>
<script src="../../../resources/ui-helper.js"></script>
</head>
<body>
<div id="editor" contenteditable>
<p>Apple banana orange.</p>
<p>Kiwi banana pear.</p>
</div>
</body>
<script>
Markup.waitUntilDone();
Markup.description("Verifies that find and replace can be used to replace words in an editable area. This test requires WebKitTestRunner.");
onload = async () => {
testRunner.findStringMatchesInPage("orange", []);
await UIHelper.ensurePresentationUpdate();
testRunner.replaceFindMatchesAtIndices([0], "apricot", false);
Markup.dump("editor", "After replacing 'orange' with 'apricot'");
testRunner.findStringMatchesInPage("banana", []);
await UIHelper.ensurePresentationUpdate();
testRunner.replaceFindMatchesAtIndices([0, 1], "watermelon", false);
Markup.dump("editor", "After replacing 'banana' with 'watermelon'");
Markup.notifyDone();
};
</script>
</html>