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