Index: third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line.html |
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line.html b/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line.html |
index 5fcffc48b42294f058c6e9ab3fbcef972a79bcc5..16f2745ad72f140b60e2b51f5afc6696f27b4c7a 100644 |
--- a/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line.html |
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line.html |
@@ -1,29 +1,26 @@ |
-<!DOCTYPE html> |
-<html> |
-<body> |
-<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> |
+<div id="log"></div> |
<script> |
- |
-if (window.testRunner) |
- testRunner.dumpEditingCallbacks(); |
- |
-// Set up the div |
-var editable = document.createElement('div'); |
-editable.contentEditable = true; |
-editable.innerHTML = '<a href="#" id="anchor">1</a><div>3</div>'; |
-document.body.appendChild(editable); |
-editable.focus(); |
- |
-// Edit it with execCommand |
-var sel = window.getSelection(); |
-sel.collapse(document.getElementById('anchor'), 1); |
-document.execCommand("InsertParagraph"); |
-document.execCommand("InsertText", false, "2"); |
- |
-Markup.description('This tests the fix for <rdar://problem/6633727> - Hitting return at the end of a line with an anchor jumps me to the bottom of the message.\n'+ |
-'If the test has passed, the numbers should be in order, and only "1" should be a link.'); |
-Markup.dump(editable); |
- |
+test(() => assert_selection( |
+ [ |
+ '<div contenteditable>', |
+ '<a href="#">1|</a><div>3</div>', |
+ '</div>', |
+ ].join(''), |
+ selection => { |
+ selection.document.execCommand('insertParagraph'); |
+ selection.document.execCommand('insertText', false, '2'); |
+ }, |
+ [ |
+ '<div contenteditable>', |
+ '<a href="#">1</a>', |
+ '<div>2|<br>', |
+ '<div>3</div>', |
+ '</div>', |
+ '</div>', |
+ ].join('')), |
+ 'Simulate hitting return at the end of line'); |
</script> |
-</body> |
-</html> |