tor-browser

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

test_popup-navigates-children.html (2385B)


      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    <style type="text/css">
      9      iframe { width: 90%; height: 50px; }
     10    </style>
     11 <script>
     12 
     13 let window0 = null;
     14 let window1 = null;
     15 let window2 = null;
     16 let window3 = null;
     17 
     18 function testChild0() {
     19  if (!window.window0)
     20    window0 = window.open("navigate.html#opener.frames[0],location", "window0", "width=10,height=10");
     21 }
     22 
     23 function testChild1() {
     24  if (!window.window1)
     25    window1 = window.open("navigate.html#child1,open", "window1", "width=10,height=10");
     26 }
     27 
     28 function testChild2() {
     29  if (!window.window2)
     30    window2 = window.open("navigate.html#child2,form", "window2", "width=10,height=10");
     31 }
     32 
     33 function testChild3() {
     34  if (!window.window3)
     35    window3 = window.open("navigate.html#child3,hyperlink", "window3", "width=10,height=10");
     36 }
     37 
     38 window.onload = async function() {
     39  await waitForFinishedFrames(4);
     40  await isNavigated(frames[0], "Should be able to navigate on-domain opener's children by setting location.");
     41  await isNavigated(frames[1], "Should be able to navigate on-domain opener's children by calling window.open.");
     42  await isNavigated(frames[2], "Should be able to navigate on-domain opener's children by submitting form.");
     43  await isNavigated(frames[3], "Should be able to navigate on-domain opener's children by targeted hyperlink.");
     44 
     45  window0.close();
     46  window1.close();
     47  window2.close();
     48  window3.close();
     49 
     50  await cleanupWindows();
     51  SimpleTest.finish();
     52 };
     53 
     54 </script>
     55 </head>
     56 <body>
     57 <div id="frames">
     58 <iframe onload="testChild0()" name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
     59 <iframe onload="testChild1()" name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
     60 <iframe onload="testChild2()" name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
     61 <iframe onload="testChild3()" name="child3" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
     62 </div>
     63 <pre id="test">
     64 <script type="text/javascript">
     65 SimpleTest.waitForExplicitFinish();
     66 </script>
     67 </pre>
     68 </body>
     69 </html>