| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 if (window.testRunner) { | 4 if (window.testRunner) { |
| 5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
| 6 testRunner.setCanOpenWindows(); | 6 testRunner.setCanOpenWindows(); |
| 7 testRunner.setPopupBlockingEnabled(true); | 7 testRunner.setPopupBlockingEnabled(true); |
| 8 testRunner.setCloseRemainingWindowsWhenComplete(true); | 8 testRunner.setCloseRemainingWindowsWhenComplete(true); |
| 9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
| 10 } | 10 } |
| 11 | 11 |
| 12 function test() { | 12 function test() { |
| 13 if (!window.testRunner) | 13 if (!window.testRunner) |
| 14 return; | 14 return; |
| 15 // Record current window count. | 15 // Record current window count. |
| 16 window.windowCount = window.testRunner.windowCount(); | 16 window.windowCount = window.testRunner.windowCount(); |
| 17 console.log("window count: " + window.testRunner.windowCount()); | 17 console.log("window count: " + window.testRunner.windowCount()); |
| 18 // Send a mouse-click event to set the input focus to the test plug-in. | 18 // Send a mouse-click event to set the input focus to the test plugin. |
| 19 eventSender.mouseMoveTo(0, 0); | 19 eventSender.mouseMoveTo(0, 0); |
| 20 eventSender.mouseMoveTo(20, 20); | 20 eventSender.mouseMoveTo(20, 20); |
| 21 eventSender.mouseDown(); | 21 eventSender.mouseDown(); |
| 22 eventSender.mouseUp(); | 22 eventSender.mouseUp(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 // This function will be called when plugin receives a mousedown event. | 25 // This function will be called when plugin receives a mousedown event. |
| 26 function popup_by_mousedown() { | 26 function popup_by_mousedown() { |
| 27 // Open a new window. | 27 // Open a new window. |
| 28 window.open("data:text/html\, open new window by mouse down", "_blank"); | 28 window.open("data:text/html\, open new window by mouse down", "_blank"); |
| 29 // Check the new opened window and logging the result. | 29 // Check the new opened window and logging the result. |
| 30 console.log("window count: " + window.testRunner.windowCount()); | 30 console.log("window count: " + window.testRunner.windowCount()); |
| 31 if (window.testRunner.windowCount() == (window.windowCount + 1)) { | 31 if (window.testRunner.windowCount() == (window.windowCount + 1)) { |
| 32 document.getElementById("mousedown_output").innerHTML = "PASSED"; | 32 document.getElementById("mousedown_output").innerHTML = "PASSED"; |
| 33 window.windowCount++; | 33 window.windowCount++; |
| 34 } | 34 } |
| 35 setTimeout(send_key_to_plugin, 100); | 35 setTimeout(send_key_to_plugin, 100); |
| 36 } | 36 } |
| 37 | 37 |
| 38 function send_key_to_plugin() { | 38 function send_key_to_plugin() { |
| 39 // Send keyboard events to the plug-in. | 39 // Send keyboard events to the plugin. |
| 40 eventSender.mouseMoveTo(0, 0); | 40 eventSender.mouseMoveTo(0, 0); |
| 41 eventSender.mouseMoveTo(60, 60); | 41 eventSender.mouseMoveTo(60, 60); |
| 42 eventSender.mouseDown(); | 42 eventSender.mouseDown(); |
| 43 eventSender.mouseUp(); | 43 eventSender.mouseUp(); |
| 44 eventSender.keyDown('p'); | 44 eventSender.keyDown('p'); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // This function will be called when plugin receives a keydown event. | 47 // This function will be called when plugin receives a keydown event. |
| 48 function popup_by_keydown() { | 48 function popup_by_keydown() { |
| 49 // Open a new window. | 49 // Open a new window. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 </script> | 65 </script> |
| 66 </head> | 66 </head> |
| 67 <body onload="internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTask
s(); test();"> | 67 <body onload="internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTask
s(); test();"> |
| 68 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescr
ipt="mouse::popup_by_mousedown()" windowedplugin="false"></embed><br> | 68 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescr
ipt="mouse::popup_by_mousedown()" windowedplugin="false"></embed><br> |
| 69 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescr
ipt="key::popup_by_keydown()" windowedplugin="false"></embed><br> | 69 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescr
ipt="key::popup_by_keydown()" windowedplugin="false"></embed><br> |
| 70 Specify a script and a mouse/keyboard event to the plugin. The specified script
will be evaluated in the browser when the specified event is received by the plu
gin. The test is for bug https://bugs.webkit.org/show_bug.cgi?id=41292.<br> | 70 Specify a script and a mouse/keyboard event to the plugin. The specified script
will be evaluated in the browser when the specified event is received by the plu
gin. The test is for bug https://bugs.webkit.org/show_bug.cgi?id=41292.<br> |
| 71 Opening window by mouse down is <span id="mousedown_output">FAILED</span><br> | 71 Opening window by mouse down is <span id="mousedown_output">FAILED</span><br> |
| 72 Opening window by key down is <span id="keydown_output">FAILED</span> | 72 Opening window by key down is <span id="keydown_output">FAILED</span> |
| 73 </body> | 73 </body> |
| 74 </html> | 74 </html> |
| OLD | NEW |