tor-browser

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

test_fetch_observer.html (903B)


      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 <head>
      8  <title>Test FetchObserver</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     11 </head>
     12 <body>
     13 <script class="testbody" type="text/javascript">
     14 
     15 SpecialPowers.pushPrefEnv({"set": [["dom.fetchObserver.enabled", true ]]}, () => {
     16  let ifr = document.createElement('iframe');
     17  ifr.src = "file_fetch_observer.html";
     18  document.body.appendChild(ifr);
     19 
     20  onmessage = function(e) {
     21    if (e.data.type == "finish") {
     22      SimpleTest.finish();
     23      return;
     24    }
     25 
     26    if (e.data.type == "check") {
     27      ok(e.data.status, e.data.message);
     28      return;
     29    }
     30 
     31    ok(false, "Something when wrong.");
     32  }
     33 });
     34 
     35 SimpleTest.waitForExplicitFinish();
     36 
     37 </script>
     38 </body>
     39 </html>