Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLAnchorElement / anchor-no-multiple-windows.html
blob6e89d699617fbbdecd4cb780f50a598b91a0244f
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.setCanOpenWindows(true);
8 testRunner.overridePreference('WebKitSupportsMultipleWindows', false);
9 testRunner.waitUntilDone();
12 function click(elmt)
14 var event = document.createEvent('MouseEvent');
15 event.initEvent('click', true, true);
16 elmt.dispatchEvent(event);
19 function runTest()
21 if (window.testRunner)
22 var windowCount = testRunner.windowCount();
23 var link = document.getElementById("link");
24 click(link);
25 if (window.testRunner) {
26 if (windowCount != testRunner.windowCount())
27 document.writeln('FAIL: Popup opened in a new window');
28 else
29 document.writeln('PASS: Popup opened in the same window');
30 testRunner.notifyDone();
34 window.addEventListener('load', runTest, true);
35 </script>
36 </head>
37 <body>
38 You need popups to be enabled to run this test.
39 <a id="link" target="_blank" href="data:text/html;charset=utf-8,<html><body>The test passes if this page opens in the same window</body></html>">Click me!</a>
40 </body>
41 </html>