Chromium Code Reviews| Index: LayoutTests/editing/selection/focus-iframe-removal-crash.html |
| diff --git a/LayoutTests/editing/selection/focus-iframe-removal-crash.html b/LayoutTests/editing/selection/focus-iframe-removal-crash.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..82c8eb446173d40b0d5d1ca4e9a9935b6b9499df |
| --- /dev/null |
| +++ b/LayoutTests/editing/selection/focus-iframe-removal-crash.html |
| @@ -0,0 +1,29 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<iframe></iframe> |
| +<script> |
| +description('Should not crash if iframe\'s document element\'s DOMFocusOut event handler removes the iframe in the parent document.'); |
| + |
| +window.jsTestIsAsync = true; |
| + |
| +function run() |
| +{ |
| + var iframe = document.getElementsByTagName('iframe')[0]; |
| + iframe.contentDocument.documentElement.contentEditable = true; |
| + iframe.contentDocument.documentElement.addEventListener('DOMFocusOut', function () { |
|
yosin_UTC9
2014/04/14 02:00:27
nit: Can we use "focusout" instead of "DOMFocusOut
Yuta Kitamura
2014/04/14 02:44:32
Done.
|
| + iframe.parentNode.removeChild(iframe); |
| + }, false); |
| + iframe.contentDocument.documentElement.focus(); |
| + |
| + testPassed('Did not crash.'); |
| + window.finishJSTest(); |
| +} |
| + |
| +document.addEventListener('DOMContentLoaded', run); |
| +</script> |
| +</body> |
| +</html> |