| Index: third_party/WebKit/LayoutTests/editing/execCommand/transpose_with_unfocused_selection.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/transpose_with_unfocused_selection.html b/third_party/WebKit/LayoutTests/editing/execCommand/transpose_with_unfocused_selection.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1efd62a038dcd5a2b0fa1c70117326b3b8a8e1d8
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/editing/execCommand/transpose_with_unfocused_selection.html
|
| @@ -0,0 +1,45 @@
|
| +<!doctype html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../assert_selection.js"></script>
|
| +<script>
|
| +test(() => {
|
| + assert_exists(window, 'testRunner', 'This test requires testRunner');
|
| +
|
| + assert_selection(
|
| + [
|
| + '<textarea>t|ext</textarea>',
|
| + '<a href="http://www.example.com/">link</a>'
|
| + ].join(''),
|
| + selection => {
|
| + const link = selection.document.querySelector('a');
|
| + link.focus();
|
| + testRunner.execCommand('transpose');
|
| + assert_equals(selection.document.activeElement, link);
|
| + },
|
| + [
|
| + '|<textarea>text</textarea>',
|
| + '<a href="http://www.example.com/">link</a>'
|
| + ].join(''));
|
| +}, 'Transpose with unfocused selection in text control');
|
| +
|
| +test(() => {
|
| + assert_exists(window, 'testRunner', 'This test requires testRunner');
|
| +
|
| + assert_selection(
|
| + [
|
| + '<div contenteditable>t|ext</div>',
|
| + '<a href="http://www.example.com/">link</a>'
|
| + ].join(''),
|
| + selection => {
|
| + const link = selection.document.querySelector('a');
|
| + link.focus();
|
| + testRunner.execCommand('transpose');
|
| + assert_equals(selection.document.activeElement, link);
|
| + },
|
| + [
|
| + '<div contenteditable>t|ext</div>',
|
| + '<a href="http://www.example.com/">link</a>'
|
| + ].join(''));
|
| +}, 'Transpose with unfocused selection in contenteditable div');
|
| +</script>
|
|
|