Bug 1427726 - move test for bug 1063538 away from jar URIs, r=baku
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 09 Apr 2018 10:08:33 +0100
changeset 412730 25b2e11c93b418defdef44aed8fd7d375c6748b3
parent 412729 2961729885f5063e8e4b224993ab3980025e2469
child 412731 bfff5b3739f90427518ba2f6f5af3d9f75e1660c
push id33817
push userapavel@mozilla.com
push dateWed, 11 Apr 2018 14:35:14 +0000
treeherdermozilla-central@14b2d3f79612 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1427726, 1063538
milestone61.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 1427726 - move test for bug 1063538 away from jar URIs, r=baku Bug 1063538 was reported with a testcase that accesses a .jsp, which in turn sleeps "forever". The testcase seems to be simulating this by using a jar:http: URI for a really big file contained in some other directory. Instead, we can just use a .sjs file that does a similar thing to the original jsp file in the reporter's testcase, which conveniently also allows us to remove dependencies on support files in other directories. MozReview-Commit-ID: 2JCOS9VLgVv
dom/workers/test/browser.ini
dom/workers/test/bug1063538.sjs
dom/workers/test/bug1063538_worker.js
dom/workers/test/mochitest.ini
dom/workers/test/test_bug1063538.html
--- a/dom/workers/test/browser.ini
+++ b/dom/workers/test/browser.ini
@@ -1,12 +1,11 @@
 [DEFAULT]
 support-files =
   bug1047663_tab.html
   bug1047663_worker.sjs
   frame_script.js
   head.js
   !/dom/base/test/file_empty.html
-  !/dom/base/test/file_bug945152.jar
 
 [browser_bug1047663.js]
 [browser_bug1104623.js]
 run-if = buildapp == 'browser'
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/bug1063538.sjs
@@ -0,0 +1,6 @@
+function handleRequest(request, response) {
+  response.processAsync();
+  response.write("Hello");
+  setTimeout(function() { response.finish(); }, 100000); // wait 100 seconds.
+}
+
--- a/dom/workers/test/bug1063538_worker.js
+++ b/dom/workers/test/bug1063538_worker.js
@@ -1,25 +1,25 @@
 /**
  * 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 gURL = "http://example.org/tests/dom/workers/test/bug1063538.sjs";
 var xhr = new XMLHttpRequest({mozAnon: true, mozSystem: true});
 var progressFired = false;
 
 xhr.onloadend = function(e) {
   postMessage({type: 'finish', progressFired: progressFired });
   self.close();
 };
 
 xhr.onprogress = function(e) {
   if (e.loaded > 0) {
     progressFired = true;
     xhr.abort();
   }
 };
 
 onmessage = function(e) {
-  xhr.open("GET", gJar, true);
+  xhr.open("GET", gURL, true);
   xhr.send();
 }
--- a/dom/workers/test/mochitest.ini
+++ b/dom/workers/test/mochitest.ini
@@ -89,17 +89,16 @@ support-files =
   worker_referrer.js
   importScripts_3rdParty_worker.js
   worker_bug1278777.js
   worker_setTimeoutWith0.js
   worker_bug1301094.js
   script_createFile.js
   worker_suspended.js
   window_suspended.html
-  !/dom/base/test/file_bug945152.jar
   !/dom/notification/test/mochitest/MockServices.js
   !/dom/notification/test/mochitest/NotificationTest.js
   !/dom/xhr/tests/relativeLoad_import.js
   !/dom/xhr/tests/relativeLoad_worker.js
   !/dom/xhr/tests/relativeLoad_worker2.js
   !/dom/xhr/tests/subdir/relativeLoad_sub_worker.js
   !/dom/xhr/tests/subdir/relativeLoad_sub_worker2.js
   !/dom/xhr/tests/subdir/relativeLoad_sub_import.js
--- a/dom/workers/test/test_bug1063538.html
+++ b/dom/workers/test/test_bug1063538.html
@@ -33,17 +33,15 @@ function runTest() {
   };
 
   worker.postMessage(true);
 }
 
 SimpleTest.waitForExplicitFinish();
 
 addLoadEvent(function() {
-  SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false]]}, function() {
-    SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], runTest);
-  });
+  SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], runTest);
 });
 
 </script>
 </pre>
 </body>
 </html>