tor-browser

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

test_bug1384658.html (1644B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1384658
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 1384658</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11  <script type="application/javascript">
     12 
     13  /** Test for Bug 1384658 */
     14 
     15 function test_frameset() {
     16  var bc = SpecialPowers.wrap(BroadcastChannel).unpartitionedTestingChannel("test_channel");
     17  bc.postMessage("go");
     18  bc.onmessage = ev => {
     19    ok(ev.data.success, "We didn't hang");
     20    bc.close();
     21    test_window();
     22  };
     23 }
     24 
     25 function test_window() {
     26  var win = window.open("http://example.com/tests/dom/websocket/tests/window_bug1384658.html",
     27                        "_blank", "width=100,height=100");
     28  var bc = SpecialPowers.wrap(BroadcastChannel).unpartitionedTestingChannel("test_channel");
     29  bc.onmessage = ev => {
     30    ok(ev.data.success, "We didn't hang");
     31    bc.close();
     32    win.close();
     33    SimpleTest.finish();
     34  };
     35 }
     36 
     37 SimpleTest.waitForExplicitFinish();
     38 // Use nsICookieService.BEHAVIOR_REJECT_TRACKER to not partition BroadcastChannel
     39 // by extra first-party domain information.
     40 SpecialPowers.pushPrefEnv({
     41  set: [
     42    ["network.cookie.cookieBehavior", 4],
     43    // disable third-party storage isolation so the test works as expected
     44    ["dom.security.https_first", false]
     45  ],
     46 }, test_frameset);
     47 
     48  </script>
     49 </head>
     50 <frameset id="frame_set" cols="25%,75%" frameborder="yes" border="5" bordercolor="#008800">
     51  <frame id="test_frame" name="test_frame" src="frame_bug1384658.html" marginwidth="20" marginheight="20">
     52 </frameset>
     53 </html>