4 <script src=
"../../resources/js-test.js"></script>
7 <a id=
"link" onclick=
"test()">click here
</a>
8 <object type=
"application/x-shockwave-flash" id=
"obj"></object>
9 <pre id=
"console"></pre>
11 window
.jsTestIsAsync
= true;
12 description("Tests that the plugin container doesn't generate user gestures");
14 if (window
.testRunner
) {
15 testRunner
.setCloseRemainingWindowsWhenComplete(true);
16 testRunner
.setCanOpenWindows();
17 testRunner
.setPopupBlockingEnabled(true);
20 if (window
.eventSender
) {
21 var link
= document
.querySelector("#link");
22 eventSender
.mouseMoveTo(link
.offsetLeft
+ 10, link
.offsetTop
+ link
.offsetHeight
/ 2);
23 eventSender
.mouseDown();
24 eventSender
.mouseUp();
28 // Consume user gesture.
29 shouldBeDefined("window.open('about:blank')");
30 // Try to create a user gesture, should not work...
31 var obj
= document
.querySelector("#obj");
34 var mousedown
= document
.createEvent("MouseEvents");
35 mousedown
.initMouseEvent("mousedown", true, true, window
, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
36 obj
.dispatchEvent(mousedown
);
37 var mouseup
= document
.createEvent("MouseEvents");
38 mouseup
.initMouseEvent("mouseup", true, true, window
, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
39 obj
.dispatchEvent(mouseup
);
40 // ... and we should not be able to open a new popup.
41 shouldBeUndefined("window.open('about:blank')");