Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html b/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..66f028f71e28aba7e416770eb3e1584191d37012 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html |
| @@ -0,0 +1,57 @@ |
| +<!doctype html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<script src="../../assert_selection.js"></script> |
| +<script> |
| +// This tests interaction with user-triggered SelectAll command and selection. |
| +// When selection is hidden, user-triggered SelectAll should act as if there is |
| +// no selection at all. |
| + |
| +test(() => { |
| + assert_exists(window, 'testRunner', 'This test requires testRunner'); |
| + |
| + assert_selection( |
| + 'foo<textarea>bar|</textarea><a href="http://www.example.com">baz</a>', |
| + selection => { |
| + selection.document.querySelector('a').focus(); |
| + testRunner.execCommand('selectAll'); |
| + }, |
| + '^foo<textarea>bar</textarea><a href="http://www.example.com">baz|</a>') |
| +}, 'User-triggered SelectAll selects entire document when there is unfocused caret selection hidden in text control'); |
| + |
| +test(() => { |
| + assert_exists(window, 'testRunner', 'This test requires testRunner'); |
| + |
| + assert_selection( |
| + 'foo<textarea>^ba|r</textarea><a href="http://www.example.com">baz</a>', |
| + selection => { |
| + selection.document.querySelector('a').focus(); |
| + testRunner.execCommand('selectAll'); |
| + }, |
| + '^foo<textarea>bar</textarea><a href="http://www.example.com">baz|</a>') |
| +}, 'User-triggered SelectAll selects entire document when there is unfocused range selection hidden in text control'); |
| + |
| +test(() => { |
| + assert_exists(window, 'testRunner', 'This test requires testRunner'); |
| + |
| + assert_selection( |
| + 'foo<div contenteditable>bar|</div><a href="http://www.example.com">baz</a>', |
| + selection => { |
| + selection.document.querySelector('a').focus(); |
| + testRunner.execCommand('selectAll'); |
| + }, |
| + '^foo<div contenteditable>bar</div><a href="http://www.example.com">baz|</a>') |
| +}, 'User-triggered SelectAll selects entire document when there is unfocused caret selection hidden in contenteditable div'); |
| + |
| +test(() => { |
| + assert_exists(window, 'testRunner', 'This test requires testRunner'); |
| + |
| + assert_selection( |
| + 'foo<div contenteditable>^ba|r</div><a href="http://www.example.com">baz</a>', |
| + selection => { |
| + selection.document.querySelector('a').focus(); |
| + testRunner.execCommand('selectAll'); |
| + }, |
| + 'foo<div contenteditable>^bar|</div><a href="http://www.example.com">baz</a>') |
| +}, 'User-triggered SelectAll selects entire document when there is unfocused range selection shown in contenteditable div'); |
|
yosin_UTC9
2017/05/19 02:19:36
I can read this description says "select entire do
Xiaocheng
2017/05/19 02:25:51
Bad copy-and-paste.
Will fix.
|
| +</script> |