1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/test_XHR_timeout.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=525816 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 525816</title> 1.11 + <script type="application/javascript" 1.12 + src="/MochiKit/MochiKit.js"></script> 1.13 + <script type="application/javascript" 1.14 + src="/tests/SimpleTest/SimpleTest.js"></script> 1.15 + <link rel="stylesheet" 1.16 + type="text/css" 1.17 + href="/tests/SimpleTest/test.css"> 1.18 +</head> 1.19 +<body> 1.20 + 1.21 +<a target="_blank" 1.22 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=525816" 1.23 + >Mozilla Bug 525816 (XMLHttpRequest timeout)</a> 1.24 +<p id="display"></p> 1.25 +<div id="content"> 1.26 + This test takes over 1 minute to run, probably over 2 minutes. 1.27 +</div> 1.28 +<pre id="test"> 1.29 +<script class="testbody" 1.30 + type="text/javascript" 1.31 + src="test_XHR_timeout.js"></script> 1.32 +<script type="text/javascript"> 1.33 + window.addEventListener("message", function (event) { 1.34 + if (event.data == "done") { 1.35 + SimpleTest.finish(); 1.36 + return; 1.37 + } 1.38 + if (event.data == "start") { 1.39 + return; 1.40 + } 1.41 + if (event.data.type == "is") { 1.42 + SimpleTest.is(event.data.got, event.data.expected, event.data.msg); 1.43 + return; 1.44 + } 1.45 + if (event.data.type == "ok") { 1.46 + SimpleTest.ok(event.data.bool, event.data.msg); 1.47 + return; 1.48 + } 1.49 + }); 1.50 + // Final test harness setup and launch. 1.51 + (function() { 1.52 + SimpleTest.waitForExplicitFinish(); 1.53 + SimpleTest.requestLongerTimeout(TestRequests.length); 1.54 + var msg = "This test will take approximately " + (TestRequests.length * 10) 1.55 + msg += " seconds to complete, at most."; 1.56 + document.getElementById("content").firstChild.nodeValue = msg; 1.57 + window.postMessage("start", "*"); 1.58 + })(); 1.59 +</script> 1.60 +</pre> 1.61 +</body> 1.62 +</html>