Index: third_party/WebKit/LayoutTests/editing/deleting/delete-to-end-of-paragraph.html |
diff --git a/third_party/WebKit/LayoutTests/editing/deleting/delete-to-end-of-paragraph.html b/third_party/WebKit/LayoutTests/editing/deleting/delete-to-end-of-paragraph.html |
index c59da98c509631272bf1b935d4b8d86004085dce..01be2dc03ca1e03227fe8dd3a4c7a66dc436c271 100644 |
--- a/third_party/WebKit/LayoutTests/editing/deleting/delete-to-end-of-paragraph.html |
+++ b/third_party/WebKit/LayoutTests/editing/deleting/delete-to-end-of-paragraph.html |
@@ -1,31 +1,44 @@ |
-<!DOCTYPE html> |
-<html> |
-<head> |
-<style> |
-.editing { |
- font-size: 24px; |
- width: 600px; |
-} |
-</style> |
-<title>Editing Test</title> |
-</head> |
-<body contenteditable id="root"> |
-<div id="test" class="editing">one two three</div><div>four five six</div> |
-<script src="../../resources/dump-as-markup.js"></script> |
+<!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.'); |
-if (!window.testRunner) |
- document.write("(cannot run interactively)"); |
-else { |
- testRunner.dumpEditingCallbacks(); |
- |
- getSelection().collapse(document.getElementById('test'), 0); |
- // test for 4570218 by using double deleteToEndOfParagraph |
- testRunner.execCommand("DeleteToEndOfParagraph"); |
- testRunner.execCommand("DeleteToEndOfParagraph"); |
- Markup.dump('test'); |
-} |
+ assert_selection( |
+ [ |
+ '<div contenteditable>', |
+ '<div>|one two three</div>', |
+ '<div>four five six</div>', |
+ '</div>', |
+ ].join(''), |
+ selection => { |
+ 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.execCommand('deleteToEndOfParagraph'); |
+ }, |
+ [ |
+ '<div contenteditable>', |
+ '<div>|four five six</div>', |
+ '</div>', |
+ ].join(''), |
+ '2 Delete an empty paragraph'); |
+ }, 'Delete to end of paragraph'); |
</script> |
-</body> |
-</html> |