Chromium Code Reviews| Index: LayoutTests/fast/forms/select-popup-close-no-crash.html |
| diff --git a/LayoutTests/fast/forms/select-popup-close-no-crash.html b/LayoutTests/fast/forms/select-popup-close-no-crash.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..830a032b06846b3577b85f89bf2962f2f34dae43 |
| --- /dev/null |
| +++ b/LayoutTests/fast/forms/select-popup-close-no-crash.html |
| @@ -0,0 +1,33 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<body> |
| +<select id="menu"> |
| +<option>foo</option> |
| +<option>bar</option> |
| +</select> |
| +<form action="data:text/html,<script>console.log('Check that first disconnecting then closing a page popup does not crash.'); console.log('PASS: no crash');testRunner.notifyDone();</script>" id="form1"> |
| +</form> |
| +<script> |
| +if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
| + testRunner.dumpAsText(); |
| +} |
| +function sendKey(input, keyName, ctrlKey, altKey) { |
| + var event = document.createEvent('KeyboardEvent'); |
| + event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName, 0, ctrlKey, altKey); |
| + input.dispatchEvent(event); |
| +} |
| +function openPicker(menu) { |
|
keishi
2015/02/11 11:44:08
We have this function in fast/forms/resources/pick
|
| + window.moveTo(); |
| + menu.offsetTop; |
| + sendKey(menu, "Down", false, true); |
| +} |
| + |
| +function runTest() { |
| + openPicker(document.getElementById('menu')); |
| + setTimeout(function() {document.getElementById('form1').submit();}, 0); |
| +} |
| +window.onload = runTest; |
| +</script> |
| +</body> |
| +</html> |