OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <title>window.open: popup vs tab</title> |
| 6 <script src="../../../resources/testharness.js"></script> |
| 7 <script src="../../../resources/testharnessreport.js"></script> |
| 8 </head> |
| 9 <body> |
| 10 <script> |
| 11 function openToolbarOnWindow() { |
| 12 return window.open("", "", "toolbar=1"); |
| 13 }; |
| 14 function openToolbarOffWindow() { |
| 15 return window.open("", "", "toolbar=0"); |
| 16 } |
| 17 function openDefaultFeaturesWindow() { |
| 18 return window.open(); |
| 19 } |
| 20 test(function() { |
| 21 var w = openToolbarOnWindow(); |
| 22 assert_equals(w.toolbar.visible, true); |
| 23 w.close(); |
| 24 }, "window.open with toolbar=1 creates a new tab"); |
| 25 test(function() { |
| 26 var w = openToolbarOffWindow(); |
| 27 assert_equals(w.toolbar.visible, false); |
| 28 w.close(); |
| 29 }, "window.open with toolbar=0 creates a new popup"); |
| 30 test(function() { |
| 31 var w = openDefaultFeaturesWindow(); |
| 32 assert_equals(w.toolbar.visible, true); |
| 33 w.close(); |
| 34 }, "window.open defaults to creating a new tab"); |
| 35 </script> |
| 36 <button onclick="openToolbarOnWindow()">Window Features: toolbar=1</button> |
| 37 <button onclick="openToolbarOffWindow()">Window Features: toolbar=0</button> |
| 38 <button onclick="openDefaultFeaturesWindow()">Window Features: default</button
> |
| 39 </body> |
| 40 </html> |
OLD | NEW |