Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Window / window-open-no-multiple-windows.html
blobc02a6a55d0220ee36f06bf935e0ae40d933b97d2
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.setCanOpenWindows(true);
8 testRunner.setPopupBlockingEnabled(false);
9 testRunner.overridePreference('WebKitSupportsMultipleWindows', false);
10 testRunner.waitUntilDone();
13 function runTest()
15 if (window.testRunner)
16 var windowCount = testRunner.windowCount();
17 var result = window.open('data:text/html;charset=utf-8,<html><body>The test passes if this page opens in the same window</body></html>');
18 if (window.testRunner) {
19 if (!result)
20 document.writeln('FAIL: window.open failed. You need popups to be enabled to run this test.');
21 else if (windowCount != testRunner.windowCount())
22 document.writeln('FAIL: Popup opened in a new window');
23 else
24 document.writeln('PASS: Popup opened in the same window');
25 testRunner.notifyDone();
29 window.addEventListener('load', runTest, true);
30 </script>
31 </head>
32 <body>
33 You need popups to be enabled to run this test.
34 </body>
35 </html>