OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <embed id="plugin" type="application/x-webkit-test-webplugin" accepts-touch="raw
" print-user-gesture-status="true" width="100" height="100"></embed> | 4 <embed id="plugin" type="application/x-webkit-test-webplugin" accepts-touch="raw
" print-user-gesture-status="true" width="100" height="100"></embed> |
5 <p> | 5 <p> |
6 Test that the user gesture indicator is correctly set for events forwarded | 6 Test that the user gesture indicator is correctly set for events forwarded |
7 through the WebPluginContainer. The tests succeeds if the first | 7 through the WebPluginContainer. The tests succeeds if the first |
8 mousedown/mouseup event pair is a user gesture, and the second is not. | 8 mousedown/mouseup event pair is a user gesture, and the second is not. Issue 8
94913002 has changed this behavior so that the second mousedown/mouseup are not
delivered to the plugin. |
9 </p> | 9 </p> |
10 <script> | 10 <script> |
11 if (!window.testRunner || !window.eventSender) { | 11 if (!window.testRunner || !window.eventSender) { |
12 document.write("This test does not work in manual mode."); | 12 document.write("This test does not work in manual mode."); |
13 } else { | 13 } else { |
14 testRunner.dumpAsText(); | 14 testRunner.dumpAsText(); |
15 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); | 15 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); |
16 | 16 |
17 // Click on the plugin. | 17 // Click on the plugin. |
18 eventSender.mouseMoveTo(20, 20); | 18 eventSender.mouseMoveTo(20, 20); |
19 eventSender.mouseDown(); | 19 eventSender.mouseDown(); |
20 eventSender.mouseUp(); | 20 eventSender.mouseUp(); |
21 | 21 |
22 // Stray mouse up event, should get its own gesture. | 22 // Stray mouse up event, should get its own gesture. |
23 eventSender.mouseUp(); | 23 eventSender.mouseUp(); |
24 | 24 |
25 // Fake mouse events | 25 // Fake mouse events |
26 var plugin = document.getElementById("plugin"); | 26 var plugin = document.getElementById("plugin"); |
27 var evt = document.createEvent("MouseEvent"); | 27 var evt = document.createEvent("MouseEvent"); |
28 evt.initMouseEvent("mousedown", true, true, window, 1, 20, 20, 20, 20, f
alse, false, false, false, 0, null); | 28 evt.initMouseEvent("mousedown", true, true, window, 1, 20, 20, 20, 20, f
alse, false, false, false, 0, null); |
29 plugin.dispatchEvent(evt); | 29 plugin.dispatchEvent(evt); |
30 | 30 |
31 evt = document.createEvent("MouseEvent"); | 31 evt = document.createEvent("MouseEvent"); |
32 evt.initMouseEvent("mouseup", true, true, window, 1, 20, 20, 20, 20, fal
se, false, false, false, 0, null); | 32 evt.initMouseEvent("mouseup", true, true, window, 1, 20, 20, 20, 20, fal
se, false, false, false, 0, null); |
33 plugin.dispatchEvent(evt); | 33 plugin.dispatchEvent(evt); |
34 } | 34 } |
35 </script> | 35 </script> |
36 </body> | 36 </body> |
37 </html> | 37 </html> |
OLD | NEW |