| 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>
|
|
|