4 <script type=
"text/javascript" src=
"/MochiKit/packed.js"></script>
5 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <script type=
"text/javascript" src=
"/tests/SimpleTest/EventUtils.js"></script>
7 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
8 <script type=
"text/javascript" src=
"NavigationUtils.js"></script>
10 window
.onload = function () {
11 document
.getElementById("link0").href
= target_url
;
12 document
.getElementById("link1").href
= target_url
;
14 sendMouseEvent({type
:"click"}, "link0");
15 sendMouseEvent({type
:"click"}, "link1");
17 xpcWaitForFinishedFrames(function() {
18 countAndClose("window0", 1);
19 countAndClose("window1", 1);
26 function countAndClose(name
, expected_count
) {
27 var array_of_frames
= xpcGetFramesByName(name
);
28 is(array_of_frames
.length
, expected_count
,
29 "Should only open " + expected_count
+
30 " window(s) with name " + name
+ " using a fancy hyperlink.");
32 for (var i
=0; i
< array_of_frames
.length
; ++i
)
33 array_of_frames
[i
].close();
38 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=279495">Mozilla Bug
279495</a>
40 <a id=
"link0" target=
"window0" onclick=
"window.open('blank.html', 'window0', 'width=10,height=10');">This is a fancy hyperlink
</a>
41 <a id=
"link1" target=
"window1" onclick=
"window.open('http://test1.example.org:80/tests/docshell/test/navigation/blank.html', 'window1', 'width=10,height=10');">This is a fancy hyperlink
</a>
44 <script type=
"text/javascript">
45 SimpleTest
.waitForExplicitFinish();