content/base/test/test_XHR_timeout.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=525816
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 525816</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=525816"
michael@0 20 >Mozilla Bug 525816 (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 class="testbody"
michael@0 27 type="text/javascript"
michael@0 28 src="test_XHR_timeout.js"></script>
michael@0 29 <script type="text/javascript">
michael@0 30 window.addEventListener("message", function (event) {
michael@0 31 if (event.data == "done") {
michael@0 32 SimpleTest.finish();
michael@0 33 return;
michael@0 34 }
michael@0 35 if (event.data == "start") {
michael@0 36 return;
michael@0 37 }
michael@0 38 if (event.data.type == "is") {
michael@0 39 SimpleTest.is(event.data.got, event.data.expected, event.data.msg);
michael@0 40 return;
michael@0 41 }
michael@0 42 if (event.data.type == "ok") {
michael@0 43 SimpleTest.ok(event.data.bool, event.data.msg);
michael@0 44 return;
michael@0 45 }
michael@0 46 });
michael@0 47 // Final test harness setup and launch.
michael@0 48 (function() {
michael@0 49 SimpleTest.waitForExplicitFinish();
michael@0 50 SimpleTest.requestLongerTimeout(TestRequests.length);
michael@0 51 var msg = "This test will take approximately " + (TestRequests.length * 10)
michael@0 52 msg += " seconds to complete, at most.";
michael@0 53 document.getElementById("content").firstChild.nodeValue = msg;
michael@0 54 window.postMessage("start", "*");
michael@0 55 })();
michael@0 56 </script>
michael@0 57 </pre>
michael@0 58 </body>
michael@0 59 </html>

mercurial