tor-browser

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

test_worker_xhr_3rdparty.html (1376B)


      1 <!--
      2  Any copyright is dedicated to the Public Domain.
      3  http://creativecommons.org/publicdomain/zero/1.0/
      4 -->
      5 <!DOCTYPE HTML>
      6 <html>
      7 <!--
      8 Tests of DOM Worker Threads XHR(Bug 450452 )
      9 -->
     10 <head>
     11  <title>Test for DOM Worker Threads XHR (Bug 450452 )</title>
     12  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     13  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     14 </head>
     15 <body>
     16 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=450452">DOM Worker Threads XHR (Bug 450452)</a>
     17 
     18 </div>
     19 <pre id="test">
     20 <script class="testbody" type="text/javascript">
     21 
     22  document.cookie = "a=cookie_is_set";
     23 
     24  // Bug 1617611: Fix all the tests broken by "cookies SameSite=lax by default"
     25  SpecialPowers.pushPrefEnv({ set: [[ "network.cookie.cookieBehavior", 1 ], ["network.cookie.sameSite.laxByDefault", false]] },
     26                            () => {
     27    let w = window.open("window_worker_xhr_3rdparty.html");
     28 
     29    onmessage = e => {
     30      if (e.data.type == "finish") {
     31        w.close();
     32        SpecialPowers.clearUserPref("network.cookie.sameSite.laxByDefault");
     33        SimpleTest.finish();
     34        return;
     35      }
     36 
     37      if (e.data.type == "test") {
     38        ok(e.data.test, e.data.msg);
     39        return;
     40      }
     41 
     42      ok(false, "Invalid message.");
     43    }
     44  });
     45 
     46  SimpleTest.waitForExplicitFinish();
     47 
     48 </script>
     49 </pre>
     50 </body>
     51 </html>