tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug279495.html (1555B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4    <script src="/tests/SimpleTest/SimpleTest.js"></script>
      5    <script 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 = async function() {
     10  document.getElementById("link0").href = target_url;
     11  document.getElementById("link1").href = target_url;
     12 
     13  sendMouseEvent({type: "click"}, "link0");
     14  sendMouseEvent({type: "click"}, "link1");
     15 
     16  await waitForFinishedFrames(2);
     17  await countAndClose("window0", 1);
     18  await countAndClose("window1", 1);
     19 
     20  await cleanupWindows();
     21  SimpleTest.finish();
     22 };
     23 
     24 async function countAndClose(name, expected_count) {
     25  var array_of_frames = await getFramesByName(name);
     26  is(array_of_frames.length, expected_count,
     27     "Should only open " + expected_count +
     28     " window(s) with name " + name + " using a fancy hyperlink.");
     29 }
     30 </script>
     31 </head>
     32 <body>
     33 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=279495">Mozilla Bug 279495</a>
     34 <div id="links">
     35 <a id="link0" target="window0" onclick="window.open('blank.html', 'window0', 'width=10,height=10');">This is a fancy hyperlink</a>
     36 <a id="link1" target="window1" onclick="window.open('https://test1.example.org/tests/docshell/test/navigation/blank.html', 'window1', 'width=10,height=10');">This is a fancy hyperlink</a>
     37 </div>
     38 <pre id="test">
     39 <script type="text/javascript">
     40 SimpleTest.waitForExplicitFinish();
     41 </script>
     42 </pre>
     43 </body>
     44 </html>