Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2593bf0622cf4fe0a8cb92b75d2f3d0996a2d7df |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html |
| @@ -0,0 +1,27 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<div id="src"> |
| +<div>Some text.</div> |
| +<div>Some other text.</div> |
| +</div> |
| +<div contenteditable="true" id="dest"></div> |
| +<div id="log"></div> |
| +<script> |
| +// A repro of crbug.com/580950, which crashes in debug build. |
| +document.body.onload = function() { |
| + var src = document.getElementById('src'); |
| + var dest = document.getElementById('dest'); |
| + var sel = window.getSelection(); |
| + dest.addEventListener('webkitEditableContentChanged', () => dest.innerHTML = ''); |
|
yosin_UTC9
2016/01/27 08:40:29
nit: It is better to insert non-empty string and n
Xiaocheng
2016/01/27 08:50:56
Done.
|
| + |
| + test(function() { |
| + sel.setBaseAndExtent(src, 0, src, src.childNodes.length); |
| + document.execCommand('copy'); |
| + dest.focus(); |
| + document.execCommand('paste'); |
| + |
| + assert_equals(dest.innerHTML, ''); |
| + }, 'A pasting that fires a webkitEditableContentChanged event should not crash.'); |
| +} |
| +</script> |