Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / undo-paste-when-caret-is-not-in-range.html
blobb9a0447857b2050bd6e7f0dc5003581200ab9da8
1 <div id="edit" contentEditable="true">abc </div>
2 <script>
3 if (window.testRunner)
4 window.testRunner.dumpAsText();
5 edit = document.getElementById("edit");
6 var s = window.getSelection();
7 s.collapse(edit, edit.childNodes.length);
8 document.execCommand("InsertText", false, " ");
9 s.setBaseAndExtent(edit.firstChild, 0, edit.firstChild, 3);
10 document.execCommand("Copy");
11 document.execCommand("InsertText", false, "def");
12 s.setBaseAndExtent(edit.firstChild, 0, edit.firstChild, 3);
13 document.execCommand("Paste");
14 s.collapse(edit, edit.childNodes.length);
15 document.execCommand("Undo");
16 document.body.innerHTML = "<div>This tests an assertion failure when undoing a paste operation when the caret is outside of the range to be undone. This test should not crash with debug build.</div>";
17 </script>