docshell/test/navigation/test_bug279495.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     5     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     6     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     7     <script type="text/javascript" src="NavigationUtils.js"></script>
     8 <script>
     9 window.onload = function () {
    10   document.getElementById("link0").href = target_url;
    11   document.getElementById("link1").href = target_url;
    13   sendMouseEvent({type:"click"}, "link0");
    14   sendMouseEvent({type:"click"}, "link1");
    16   xpcWaitForFinishedFrames(function() {
    17     countAndClose("window0", 1);
    18     countAndClose("window1", 1);
    20     xpcCleanupWindows();
    21     SimpleTest.finish();
    22   }, 2);
    23 }
    25 function countAndClose(name, expected_count) {
    26   var array_of_frames = xpcGetFramesByName(name);
    27   is(array_of_frames.length, expected_count,
    28      "Should only open " + expected_count +
    29      " window(s) with name " + name + " using a fancy hyperlink.");
    31   for (var i=0; i < array_of_frames.length; ++i)
    32     array_of_frames[i].close();
    33 }
    34 </script>
    35 </head>
    36 <body>
    37 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=279495">Mozilla Bug 279495</a>
    38 <div id="links">
    39 <a id="link0" target="window0" onclick="window.open('blank.html', 'window0', 'width=10,height=10');">This is a fancy hyperlink</a>
    40 <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>
    41 </div>
    42 <pre id="test">
    43 <script type="text/javascript">
    44 SimpleTest.waitForExplicitFinish();
    45 </script>
    46 </pre>
    47 </body>
    48 </html>

mercurial