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

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

Issue 2177173002: Convert editing/inserting/insert-tab-00[1-4].html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-25T18:11:29 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_tab.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html b/third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html
new file mode 100644
index 0000000000000000000000000000000000000000..5aff7a3453d5658f475f3032a62ebb07710f8c10
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert_tab.html
@@ -0,0 +1,78 @@
+<!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>',
+ '<span>|foo</span>',
+ '</div>',
+ ].join(''),
+ 'insertText \t',
+ [
+ '<div contenteditable>',
+ '<span>',
+ '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+ 'foo',
+ '</span>',
+ '</div>'
+ ].join('')),
+ 'Insert a tab character before text');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<span>foo|</span>',
+ '</div>',
+ ].join(''),
+ 'insertText \t',
+ [
+ '<div contenteditable>',
+ '<span>',
+ 'foo',
+ '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+ '</span>',
+ '</div>'
+ ].join('')),
+ 'Insert a tab character after text');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<span>fo|o</span>',
+ '</div>',
+ ].join(''),
+ 'insertText \t',
+ [
+ '<div contenteditable>',
+ '<span>',
+ 'fo',
+ '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+ 'o',
+ '</span>',
+ '</div>'
+ ].join('')),
+ 'Insert a tab character in text');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<span>|foo</span>',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('insertLineBreak');
+ selection.document.execCommand('insertText', false, '\t');
+ },
+ [
+ '<div contenteditable>',
+ '<span>',
+ '<br>',
+ '<span class="Apple-tab-span" style="white-space:pre">\t|</span>',
+ 'foo',
+ '</span>',
+ '</div>'
+ ].join('')),
+ 'Insert BR and a tab character before text');
+</script>

Powered by Google App Engine
This is Rietveld 408576698