summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/file_XHR_timeout.sjs
diff options
context:
space:
mode:
Diffstat (limited to 'dom/xhr/tests/file_XHR_timeout.sjs')
-rw-r--r--dom/xhr/tests/file_XHR_timeout.sjs15
1 files changed, 15 insertions, 0 deletions
diff --git a/dom/xhr/tests/file_XHR_timeout.sjs b/dom/xhr/tests/file_XHR_timeout.sjs
new file mode 100644
index 000000000..b349d122e
--- /dev/null
+++ b/dom/xhr/tests/file_XHR_timeout.sjs
@@ -0,0 +1,15 @@
+var timer = null;
+
+function handleRequest(request, response)
+{
+ response.processAsync();
+ timer = Components.classes["@mozilla.org/timer;1"]
+ .createInstance(Components.interfaces.nsITimer);
+ timer.initWithCallback(function()
+ {
+ response.setStatusLine(null, 200, "OK");
+ response.setHeader("Content-Type", "text/plain", false);
+ response.write("hello");
+ response.finish();
+ }, 3000 /* milliseconds */, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
+}