Bug 1063538 - Part 2: Test case. r=khuey
authorShian-Yow Wu <swu@mozilla.com>
Fri, 14 Nov 2014 14:17:27 +0800
changeset 215713 14391d50460e216f46ca88e0fe707c05fcb90669
parent 215712 d75aafdbe1a6db60ae5312dd8cd5bf014bb5c79e
child 215714 48667a14f94dcc46be8bb69cea1b7020eece58a3
push id27823
push usercbook@mozilla.com
push dateFri, 14 Nov 2014 11:59:57 +0000
treeherdermozilla-central@bbb68df450c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1063538
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1063538 - Part 2: Test case. r=khuey
dom/workers/test/bug1063538_worker.js
dom/workers/test/mochitest.ini
dom/workers/test/test_bug1063538.html
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/bug1063538_worker.js
@@ -0,0 +1,18 @@
+/**
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+var gJar = "jar:http://example.org/tests/dom/base/test/file_bug945152.jar!/data_big.txt";
+var xhr = new XMLHttpRequest({mozAnon: true, mozSystem: true});
+
+xhr.onprogress = function(e) {
+  xhr.abort();
+  postMessage({type: 'finish' });
+  self.close();
+};
+
+onmessage = function(e) {
+  xhr.open("GET", gJar, true);
+  xhr.send();
+}
--- a/dom/workers/test/mochitest.ini
+++ b/dom/workers/test/mochitest.ini
@@ -4,16 +4,17 @@ support-files =
   atob_worker.js
   bug978260_worker.js
   bug1014466_data1.txt
   bug1014466_data2.txt
   bug1014466_worker.js
   bug1020226_worker.js
   bug1020226_frame.html
   bug998474_worker.js
+  bug1063538_worker.js
   clearTimeouts_worker.js
   closeOnGC_server.sjs
   closeOnGC_worker.js
   close_worker.js
   content_worker.js
   console_worker.js
   consoleReplaceable_worker.js
   csp_worker.js
@@ -101,16 +102,17 @@ support-files =
 [test_blobWorkers.html]
 [test_bug1002702.html]
 [test_bug949946.html]
 [test_bug1010784.html]
 [test_bug1014466.html]
 [test_bug1020226.html]
 [test_bug1036484.html]
 [test_bug998474.html]
+[test_bug1063538.html]
 [test_chromeWorker.html]
 [test_clearTimeouts.html]
 [test_close.html]
 [test_closeOnGC.html]
 [test_console.html]
 [test_consoleReplaceable.html]
 [test_contentWorker.html]
 [test_csp.html]
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/test_bug1063538.html
@@ -0,0 +1,47 @@
+<!--
+2   Any copyright is dedicated to the Public Domain.
+3   http://creativecommons.org/publicdomain/zero/1.0/
+4 -->
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1063538
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1063538</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1063538">Mozilla Bug 1063538</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+function runTest() {
+  var worker = new Worker("bug1063538_worker.js");
+
+  worker.onmessage = function(e) {
+    if (e.data.type == 'finish') {
+      ok(true, "Testing done.\n");
+      SimpleTest.finish();
+    }
+  };
+
+  worker.postMessage(true);
+}
+
+SimpleTest.waitForExplicitFinish();
+
+addLoadEvent(function() {
+  SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], runTest);
+});
+
+</script>
+</pre>
+</body>
+</html>