Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / popup-allowed-from-gesture-only-once-iframes.html
blob37471385171d143b36f5564f6153bffcf2dee136
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>
5 Test that we don't create a new user gesture indicator every time
6 an event is passed to an iframe.
7 </p>
8 <p>
9 To run, click on the iframe. The test passes, if only one window
10 is opened in response to the click.
11 </p>
12 <iframe id="iframe" src="about:blank"></iframe>
13 <div id="console"></div>
14 <script>
15 var iframe = document.getElementById("iframe");
16 iframe.contentDocument.body.onclick = function() {
17 window.open("about:blank", "window1");
18 window.open("about:blank", "window2");
19 if (window.testRunner) {
20 if (testRunner.windowCount() == windowCount + 1)
21 document.getElementById("console").innerText = "PASSED";
22 else
23 document.getElementById("console").innerText = "FAILED";
24 testRunner.notifyDone();
28 if (window.testRunner) {
29 testRunner.dumpAsText();
30 testRunner.setCanOpenWindows();
31 testRunner.setPopupBlockingEnabled(true);
32 testRunner.setCloseRemainingWindowsWhenComplete(true);
33 testRunner.waitUntilDone();
34 windowCount = testRunner.windowCount();
36 var frame = document.getElementById("iframe");
38 if (window.eventSender) {
39 eventSender.mouseMoveTo(frame.offsetLeft + frame.offsetWidth / 2, frame.offsetTop + frame.offsetHeight / 2);
40 eventSender.mouseDown();
41 eventSender.mouseUp();
44 </script>
45 </body>
46 </html>