Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html b/third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..79a61e6542c70ab47555abec5734f32dfacd3c17 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html |
| @@ -0,0 +1,37 @@ |
| +<!doctype html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="../assert_selection.js"></script> |
| +<script> |
| +// Regression test for crbug.com/685975 |
| + |
| +test(() => { |
| + assert_not_equals(window.testRunner, undefined, |
| + 'This test requires testRunner'); |
| + |
| + assert_selection( |
| + [ |
| + '<div contenteditable id="div1">|</div>', |
| + '<div contenteditable id="div2">bar</div>' |
| + ].join(''), |
| + selection => { |
| + const document = selection.document; |
| + const source = document.getElementById('source'); |
| + const div1 = document.getElementById('div1'); |
| + const div2 = document.getElementById('div2'); |
| + div1.addEventListener('DOMNodeInserted', () => { |
| + div2.focus(); |
| + document.execCommand('selectAll'); |
| + document.execCommand('delete'); |
| + }); |
| + |
| + selection.setClipboardData('foo'); |
| + testRunner.execCommand('paste'); // Must be user-initiated paste. |
| + document.execCommand('undo'); |
|
yosin_UTC9
2017/02/20 06:12:02
Do we have other test scripts want to check undo s
Xiaocheng
2017/02/22 02:36:20
Guess your comment in the other patch means you ar
|
| + }, |
| + [ |
| + '<div contenteditable id="div1">foo</div>', |
| + '<div contenteditable id="div2">^bar|</div>' |
| + ].join('')); |
| +}, 'Undo ordering maintained when pasting triggers another command with mutation event.'); |
| +</script> |