Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / popup-when-select-change.html
blob5d6b480a7ad39ea236c4a7265f1197edf7182eab
1 <html>
2 <head>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.setCanOpenWindows();
7 testRunner.setPopupBlockingEnabled(true);
8 testRunner.setCloseRemainingWindowsWhenComplete(true);
9 testRunner.waitUntilDone();
12 function test() {
13 // Test for select that's not inside a form element
14 var ctrl1 = document.getElementById('control1');
15 ctrl1.focus();
17 if (window.testRunner) {
18 // change the option selection
19 eventSender.keyDown("e", []);
21 // hit enter
22 var enterEvent = document.createEvent("KeyboardEvents");
23 enterEvent.initKeyboardEvent("keypress", true, false, window, "Enter", 0, false, false, false, false, false);
24 ctrl1.dispatchEvent(enterEvent);
25 // Change focus to trigger the "Enter" press.
26 var ctrl2 = document.getElementById('control2');
27 ctrl2.focus();
30 function onpopup() {
31 // We rely on sequential ordering of POST processing.
32 var form = document.getElementById('form');
33 form.submit();
34 var form2 = document.getElementById('form2');
35 form2.submit();
37 </script>
38 </head>
39 <body onload="test()">
40 <select onchange="onpopup()" id="control1"><option value="0">abcd</option><option value="0">efgh</option></select>
41 If the pop-up was not blocked then there will be an PASS message. Otherwise, the test fails.
42 <form id="form" action="data:text/html,<script>console.log('PASSED')</script>" target="target">
43 <input id="control2" type="submit" value="Submit to new window"/>
44 </form>
45 <form id="form2" action="data:text/html,<b>hello!</b><script>window.testRunner && testRunner.notifyDone()</script>" target="panel">
46 <input type="submit" value="Submit local page Javascript"/>
47 </form>
48 <iframe name="target"></iframe><iframe name="panel"></iframe>
49 </body>
50 </html>