Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / popup-blocked-from-wrong-event.html
blobd4210d411634878a971655f41597c9e4f1a461b9
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <a id="link" onclick="test()">click here</a>
8 <object type="application/x-shockwave-flash" id="obj"></object>
9 <pre id="console"></pre>
10 <script>
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();
27 function test() {
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");
32 obj.focus();
33 obj.click();
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')");
42 finishJSTest();
44 </script>
45 </body>
46 </html>