Chromium Code Reviews| Index: LayoutTests/editing/undo/undo-set-selection-crash.html |
| diff --git a/LayoutTests/editing/undo/undo-set-selection-crash.html b/LayoutTests/editing/undo/undo-set-selection-crash.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4b9c3ee9b107b438809daf13af23c9568f93a835 |
| --- /dev/null |
| +++ b/LayoutTests/editing/undo/undo-set-selection-crash.html |
| @@ -0,0 +1,37 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<div id="test-div" contentEditable="true"><select></div> |
|
yosin_UTC9
2014/06/12 06:38:10
nit: It it better to have "</select>". Does omitti
Yuta Kitamura
2014/06/12 07:34:49
Oops, I thought the close tag was omissible just l
|
| +<script> |
| +description('Undo command should not make a selection anchored in another document.'); |
| + |
| +window.jsTestIsAsync = true; |
| + |
| +var div = document.getElementById('test-div'); |
| + |
|
yosin_UTC9
2014/06/12 06:38:10
nit: We don't need to have this extra blank line.
Yuta Kitamura
2014/06/12 07:34:49
Done.
|
| +var selection = window.getSelection(); |
| + |
| +div.focus(); |
| +document.execCommand('SelectAll'); |
| +document.execCommand('Indent'); |
| +document.execCommand('Outdent'); |
| + |
| +var anotherDocument = document.implementation.createHTMLDocument(''); |
| +anotherDocument.body.appendChild(selection.getRangeAt(0).extractContents()); |
| + |
| +div.contentEditable = false; |
| + |
| +document.execCommand('Undo'); |
| +document.execCommand('FindString', false, 'x'); |
| + |
| +window.setTimeout(function () { |
| + document.body.removeChild(div); |
| + testPassed('Did not crash.'); |
| + finishJSTest(); |
| +}, 0); |
| +</script> |
| +</body> |
| +</html> |