CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / docshell / test / navigation / test_bug279495.html
blobddca294b3ab27a072d38c8f31072b5ea5e5f157e
1 <!DOCTYPE html>
2 <html>
3 <head>
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>
9 <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);
21 xpcCleanupWindows();
22 SimpleTest.finish();
23 }, 2);
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();
35 </script>
36 </head>
37 <body>
38 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=279495">Mozilla Bug 279495</a>
39 <div id="links">
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>
42 </div>
43 <pre id="test">
44 <script type="text/javascript">
45 SimpleTest.waitForExplicitFinish();
46 </script>
47 </pre>
48 </body>
49 </html>