blob: 5c73362b9da945f7b2fe9b247b55d6379c991f76 [file] [log] [blame]
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => {
assert_not_equals(window.internals, undefined,
'This test requires window.internals to access clipboard');
assert_selection(
[
'<div contenteditable>',
'<div>^foo</div>',
'<div>bar|</div>',
'</div>',
'<div contenteditable id="paste"><br></div>',
].join(''),
selection => {
selection.document.execCommand('copy');
selection.collapse(selection.document.getElementById('paste'), 0);
selection.document.execCommand('paste');
selection.document.execCommand('undo');
},
[
'<div contenteditable>',
'<div>foo</div>',
'<div>bar</div>',
'</div>',
'<div contenteditable id="paste">|<br></div>',
].join(''));
});
</script>