<!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.testRunner, undefined,
'This test requires testRunner.');
assert_selection(
[
'<div contenteditable>',
'<div>|one two three</div>',
'<div>four five six</div>',
'</div>',
].join(''),
(selection, testRunner) => {
testRunner.execCommand('deleteToEndOfParagraph');
},
[
'<div contenteditable>',
'<div>|<br></div><div>four five six</div>',
'</div>',
].join(''),
'1 Delete a paragraph');
assert_selection(
[
'<div contenteditable>',
'<div>|<br></div>',
'<div>four five six</div>',
'</div>',
].join(''),
(selection, testRunner) => {
testRunner.execCommand('deleteToEndOfParagraph');
},
[
'<div contenteditable>',
'<div>|four five six</div>',
'</div>',
].join(''),
'2 Delete an empty paragraph');
}, 'Delete to end of paragraph');
</script>