Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / popup-blocked-from-different-frames.html
blob8b141639b127f796b74c5ae63c51044a0925031c
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <style>
6 iframe {
7 position: absolute;
8 width: 100%;
9 height: 100%;
10 left: 0;
11 top: 0;
12 z-index: 42;
15 iframe.start {
16 display: none;
18 </style>
19 </head>
20 <body>
21 <iframe class="start" src="about:blank"></iframe>
22 <button id="test">Click Here</button>
23 <div id="console"></div>
24 <script>
25 var win;
26 function clickHandler1()
28 win = window.open("about:blank");
29 shouldBeNonNull("win");
30 win.close();
31 document.querySelector("iframe").setAttribute("class", "");
34 function clickHandler2()
36 win = window.open("about:blank");
37 shouldBeUndefined("win");
40 document.querySelector("#test").addEventListener("mousedown", clickHandler1);
41 document.querySelector("iframe").contentDocument.body.addEventListener("mouseup", clickHandler2);
44 if (window.testRunner) {
45 testRunner.dumpAsText();
46 testRunner.setCanOpenWindows();
47 testRunner.setPopupBlockingEnabled(true);
48 testRunner.setCloseRemainingWindowsWhenComplete(true);
50 var button = document.querySelector("#test");
52 eventSender.mouseMoveTo(button.offsetLeft + button.offsetWidth / 2, button.offsetTop + button.offsetHeight / 2);
53 eventSender.mouseDown();
54 eventSender.mouseUp();
56 </script>
57 </body>
58 </html>