dom/workers/test/test_xhr_timeout.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial