Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line.html

Issue 2284353002: Convert editing/inserting/insert-paragraph-at-end-of-line.html to use w3c test harness (Closed)
Patch Set: 2016-08-29T17:35:26 Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-at-end-of-line-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698