| Index: third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html b/third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f58963051c559aa19bf6e771d36d7134cf0ec94b
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html
|
| @@ -0,0 +1,49 @@
|
| +<!doctype html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../assert_selection.js"></script>
|
| +<script>
|
| + const isMac = navigator.platform.indexOf('Mac') === 0;
|
| + const kDeleteWordModifiers = isMac ? ['altKey'] : ['ctrlKey'];
|
| +
|
| + test(() => {
|
| + assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
|
| + assert_selection(
|
| + [
|
| + '<div contenteditable>',
|
| + 'one two |cha cha three four cha cha cha',
|
| + '</div>',
|
| + ].join(''),
|
| + selection => {
|
| + selection.document.execCommand('insertText', false, ' abc');
|
| + eventSender.keyDown('Backspace', kDeleteWordModifiers);
|
| + selection.document.execCommand('insertText', false, ' cha');
|
| + },
|
| + // BR is a placeholder.
|
| + [
|
| + '<div contenteditable>',
|
| + 'one two \u{00A0}abc cha|cha cha three four cha cha cha',
|
| + '</div>',
|
| + ].join(''));
|
| + }, 'Delete word');
|
| +
|
| + test(() => {
|
| + assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
|
| + assert_selection(
|
| + [
|
| + '<div contenteditable>',
|
| + 'one two |three four',
|
| + '</div>',
|
| + ].join(''),
|
| + selection => {
|
| + eventSender.keyDown('Backspace', kDeleteWordModifiers);
|
| + selection.document.execCommand('undo');
|
| + },
|
| + // BR is a placeholder.
|
| + [
|
| + '<div contenteditable>',
|
| + 'one two |three four',
|
| + '</div>',
|
| + ].join(''));
|
| + }, 'Delete word then undo');
|
| +</script>
|
|
|