1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <title>New Window Opener Test
</title>
5 <script src=
"../../../resources/js-test.js"></script>
10 <script type=
"text/javascript">
11 if (window
.testRunner
) {
12 testRunner
.dumpAsText();
13 testRunner
.waitUntilDone();
14 testRunner
.setCanOpenWindows();
19 'This tests that the different arguments given to a new window are honored.<br/>\
20 Take note that menubar is special and always on in Mac but not in Win.'
23 var args
= [ "scrollbars=yes,width=75,height=100"
24 , "scrollbars=no,width=75,height=100"
25 , "scrollbars=1,width=75,height=100"
26 , "scrollbars=0,width=75,height=100"
27 , "toolbar=yes,width=75,height=100"
28 , "toolbar=no,width=75,height=100"
29 , "toolbar=1,width=75,height=100"
30 , "toolbar=0,width=75,height=100"
31 , "status=yes,width=75,height=100"
32 , "status=no,width=75,height=100"
33 , "status=1,width=75,height=100"
34 , "status=0,width=75,height=100"
35 , "menubar=yes,width=75,height=100"
36 , "menubar=no,width=75,height=100"
37 , "menubar=1,width=75,height=100"
38 , "menubar=0,width=75,height=100"
39 , "location=yes,width=75,height=100"
40 , "location=no,width=75,height=100"
41 , "location=1,width=75,height=100"
42 , "location=0,width=75,height=100"
45 var actual
= [ "newWin.scrollbars.visible", "newWin.scrollbars.visible", "newWin.scrollbars.visible", "newWin.scrollbars.visible"
46 , "newWin.toolbar.visible", "newWin.toolbar.visible", "newWin.toolbar.visible", "newWin.toolbar.visible"
47 , "newWin.statusbar.visible", "newWin.statusbar.visible", "newWin.statusbar.visible", "newWin.statusbar.visible"
48 , "newWin.menubar.visible", "newWin.menubar.visible", "newWin.menubar.visible", "newWin.menubar.visible"
49 , "newWin.locationbar.visible", "newWin.locationbar.visible", "newWin.locationbar.visible", "newWin.locationbar.visible"
52 var expected
= [ "true", "false", "true", "false"
53 , "true", "false", "true", "false"
54 , "true", "false", "true", "false"
55 , "true", "isMenubarAlwaysExpected", "true", "isMenubarAlwaysExpected"
56 , "true", "false", "true", "false"
59 // Since Mac always shows the menu bar we need to special case it, but in
60 // a way that does not require platform specific results.
61 var isMacOSX
= navigator
.userAgent
.indexOf("Mac OS X");
62 var isMenubarAlwaysExpected
;
64 isMenubarAlwaysExpected
= true;
66 isMenubarAlwaysExpected
= false;
69 var lastTest
= args
.length
;
74 if (testNum
== lastTest
) {
75 isSuccessfullyParsed();
76 if (window
.testRunner
)
77 testRunner
.notifyDone();
79 } else if (testNum
== 0) {
82 } else if (testNum
== 4) {
85 } else if (testNum
== 8) {
88 } else if (testNum
== 12) {
91 } else if (testNum
== 16) {
96 //get the next test and run it.
97 newWin
= window
.open("../resources/abe.png", "testWindow", args
[testNum
] );
98 shouldBe(actual
[testNum
], expected
[testNum
]);
100 closeAndRunNextTest(newWin
);
103 function closeAndRunNextTest(winToClose
) {
105 setTimeout(doneHandler
, 1);
107 function doneHandler() {
108 if (winToClose
.closed
) {
109 setTimeout(nextTest
, 1);
112 setTimeout(doneHandler
, 1);