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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph.html

Issue 2175233002: Convert editing/inserting/insert-paragraph-0[1-5].html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-26T13:41:23 Created 4 years, 5 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
Index: third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph.html b/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph.html
new file mode 100644
index 0000000000000000000000000000000000000000..2b1cdf1eee9437363cae7a48a6ad840fb91d86b3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph.html
@@ -0,0 +1,85 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '|<table><tr><td>foo</td></tr></table>',
+ '</div>',
+ ].join(''),
+ 'insertParagraph',
+ [
+ '<div contenteditable>',
+ '<br>',
+ '|<table><tbody><tr><td>foo</td></tr></tbody></table>',
+ '</div>',
+ ].join('')),
+ 'Insert BR before table');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<table><tr><td>foo</td></tr></table>',
+ '|bar',
+ '</div>',
+ ].join(''),
+ 'insertParagraph',
+ [
+ '<div contenteditable>',
+ '<table><tbody><tr><td>foo</td></tr></tbody></table>',
+ '<br>',
+ '<div>|bar</div>',
+ '</div>',
+ ].join('')),
+ 'Insert BR and enclose with DIV');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ 'foo|<hr>bar',
+ '</div>',
+ ].join(''),
+ 'insertParagraph',
+ [
+ '<div contenteditable>',
+ 'foo',
+ '<div>|<br><hr>bar</div>',
+ '</div>',
+ ].join('')),
+ 'Insert BR before HR');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ 'foo<hr>|bar',
+ '</div>',
+ ].join(''),
+ selection => {
+ // Set selection to afterNode(HR)
+ selection.modify('move', 'backward', 'character');
+ selection.document.execCommand('insertParagraph');
+ },
+ [
+ '<div contenteditable>',
+ 'foo<hr>|<br>bar',
+ '</div>',
+ ].join('')),
+ 'Insert BR after HR');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<a href="http://example.com">|example</a>',
+ '</div>',
+ ].join(''),
+ 'insertParagraph',
+ [
+ '<div contenteditable>',
+ '<div><br></div>',
+ '<a href="http://example.com">|example</a>',
+ '</div>',
+ ].join('')),
+ 'Insert DIV+BR before A');
+</script>

Powered by Google App Engine
This is Rietveld 408576698