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

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

Issue 2338013005: Convert editing/inserting/insert-div-02[34].html to use w3c test harness (Closed)
Patch Set: 2016-09-15T15:23:49 Created 4 years, 3 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_and_style.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph_and_style.html b/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph_and_style.html
new file mode 100644
index 0000000000000000000000000000000000000000..caa5ed7e9bedc78e58d039a9cbe668ff408c44ca
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert_paragraph_and_style.html
@@ -0,0 +1,54 @@
+<!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>',
+ '<p>one</p>',
+ '<p><br></p>',
+ '<p><b>two|</b></p>',
+ '<p><br></p>',
+ '<p>three</p>',
+ '</div>',
+ ].join(''),
+ 'insertParagraph',
+ [
+ '<div contenteditable>',
+ '<p>one</p>',
+ '<p><br></p>',
+ '<p><b>two</b></p>',
+ '<p><b>|<br></b></p>',
+ '<p><br></p>',
+ '<p>three</p>',
+ '</div>',
+ ].join('')),
+ 'insert BR in B');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<p>^one|</p>',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('bold');
+ selection.modify('move', 'forward', 'character');
+ selection.document.execCommand('insertParagraph');
+ // Set typing style to non-bold
+ selection.document.execCommand('bold');
+ selection.document.execCommand('insertText', false, 'abc');
+ selection.document.execCommand('insertParagraph');
+ selection.document.execCommand('insertParagraph');
+ },
+ [
+ '<div contenteditable>',
+ '<p><b>one</b></p>',
+ '<p>abc</p>',
+ '<p><br></p>',
+ '<p>|<br></p>',
+ '</div>',
+ ].join('')),
+ 'insert BR twice');
+</script>

Powered by Google App Engine
This is Rietveld 408576698