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
--- 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>