summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html
blob: 32026d287095eecd89b600bfa52f5028317699f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html> 
    <head>
        <link rel="stylesheet" href="../js/resources/js-test-style.css">
        <script src="../js/resources/js-test-pre.js"></script>
    </head>
    <body>
        <a id=test href="javascript:popup()">test</a>
        <div id="console"></div>
        <script> 
            var win;
            function popup() {
                win = window.open('about:blank','blank','height=200,width=200');
                shouldBeUndefined("win");
            }

            if (window.layoutTestController) {
                layoutTestController.dumpAsText();
                layoutTestController.setCanOpenWindows();
                layoutTestController.setPopupBlockingEnabled(true);
                layoutTestController.setCloseRemainingWindowsWhenComplete(true);
                layoutTestController.waitUntilDone();
            }

            clickEvent = document.createEvent("MouseEvents");
            clickEvent.initEvent("click", true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
            document.getElementById("test").dispatchEvent(clickEvent);

            if (window.layoutTestController)
                layoutTestController.notifyDone();
        </script> 
    </body> 
</html>