tor-browser

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

test_worker_xhr_timeout.html (1484B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=498998
      5 -->
      6 <head>
      7  <title>Test for Bug 498998</title>
      8  <script type="application/javascript"
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet"
     11        type="text/css"
     12        href="/tests/SimpleTest/test.css">
     13 </head>
     14 <body>
     15 
     16 <a target="_blank"
     17   href="https://bugzilla.mozilla.org/show_bug.cgi?id=498998"
     18  >Mozilla Bug 498998 (Worker XMLHttpRequest timeout)</a>
     19 <p id="display"></p>
     20 <div id="content">
     21  This test takes over 1 minute to run, probably over 2 minutes.
     22 </div>
     23 <pre id="test">
     24 <script type="text/javascript">
     25  var worker = new Worker("../../../dom/xhr/tests/test_XHR_timeout.js");
     26 
     27  worker.addEventListener("message", function (event) {
     28  if (event.data == "done") {
     29    SimpleTest.finish();
     30    return;
     31  }
     32  if (event.data == "start") {
     33    return;
     34  }
     35  if (event.data.type == "is") {
     36    SimpleTest.is(event.data.got, event.data.expected, event.data.msg);
     37    return;
     38  }
     39  if (event.data.type == "ok") {
     40    SimpleTest.ok(event.data.bool, event.data.msg);
     41 
     42  }
     43 });
     44  // Final test harness setup and launch.
     45  (function() {
     46    SimpleTest.waitForExplicitFinish();
     47    SimpleTest.requestLongerTimeout(20);
     48    var msg = "This test will take approximately " + (20 * 10)
     49    msg += " seconds to complete, at most.";
     50    document.getElementById("content").firstChild.nodeValue = msg;
     51    worker.postMessage("start");
     52  })();
     53 </script>
     54 </pre>
     55 </body>
     56 </html>