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/typing.html

Issue 2184503003: Convert editing/inserting/typing-00[1-3].html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-26T14:42:22 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/inserting/typing-001.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/inserting/typing.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/typing.html b/third_party/WebKit/LayoutTests/editing/inserting/typing.html
new file mode 100644
index 0000000000000000000000000000000000000000..253036269f53808a2686842cab5717a24aaea929
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/inserting/typing.html
@@ -0,0 +1,48 @@
+<!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>|XXXX</span></div>',
+ selection => {
+ for (var i = 0; i < 3; ++i)
+ selection.document.execCommand('insertText', false, 'a');
+ for (var i = 0; i < 2; ++i)
+ selection.modify('move', 'forward', 'character');
+ for (var i = 0; i < 3; ++i)
+ selection.document.execCommand('insertText', false, 'b');
+ for (var i = 0; i < 2; ++i)
+ selection.modify('move', 'forward', 'character');
+ for (var i = 0; i < 3; ++i)
+ selection.document.execCommand('insertText', false, 'c');
+ },
+ '<div contenteditable><span>aaaXXbbbXXccc|</span></div>'),
+ 'Typing simulation 1');
+
+test(() => assert_selection(
+ '<div contenteditable>|Foo <i> bar</i></div>',
+ selection => {
+ for (var i = 0; i < 4; ++i)
+ selection.modify('move', 'forward', 'character');
+ for (var i = 0; i < 3; ++i)
+ selection.document.execCommand('insertText', false, 'x');
+ },
+ '<div contenteditable>Foo xxx|<i>bar</i></div>'),
+ 'Typing simulation 2');
+
+test(() => assert_selection(
+ '<div contenteditable><span>|</span></div>',
+ selection => {
+ function typeWord(n) {
+ for (var i = 0; i < n; ++i)
+ selection.document.execCommand('insertText', false, 'x');
+ selection.document.execCommand('insertText', false, ' ');
+ }
+ typeWord(4);
+ typeWord(1);
+ typeWord(2);
+ },
+ '<div contenteditable>xxxx x xx\u{00A0}|<span></span></div>'),
+ 'Typing simulation 3');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/inserting/typing-001.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698