Bug 1291024 - Avoid caching safebrowsing testcase resources. r?francois
MozReview-Commit-ID: 9SB5diTrr5F
new file mode 100644
--- /dev/null
+++ b/toolkit/components/url-classifier/tests/mochitest/bad.css^headers^
@@ -0,0 +1,1 @@
+Cache-Control: no-store
new file mode 100644
--- /dev/null
+++ b/toolkit/components/url-classifier/tests/mochitest/evil.css^headers^
@@ -0,0 +1,1 @@
+Cache-Control: no-store
--- a/toolkit/components/url-classifier/tests/mochitest/evil.js^headers^
+++ b/toolkit/components/url-classifier/tests/mochitest/evil.js^headers^
@@ -1,1 +1,2 @@
Access-Control-Allow-Origin: *
+Cache-Control: no-store
--- a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
@@ -3,32 +3,34 @@ skip-if = buildapp == 'b2g'
support-files =
classifiedAnnotatedPBFrame.html
classifierCommon.js
classifierFrame.html
classifierHelper.js
cleanWorker.js
good.js
evil.css
+ evil.css^headers^
evil.js
evil.js^headers^
evilWorker.js
import.css
raptor.jpg
track.html
unwantedWorker.js
vp9.webm
whitelistFrame.html
workerFrame.html
ping.sjs
basic.vtt
dnt.html
dnt.sjs
update.sjs
bad.css
+ bad.css^headers^
gethash.sjs
gethashFrame.html
[test_classifier.html]
skip-if = (os == 'linux' && debug) #Bug 1199778
[test_classifier_worker.html]
[test_classify_ping.html]
[test_classify_track.html]
--- a/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
@@ -284,16 +284,21 @@ function runTest() {
SimpleTest.finish();
}).catch(function(e) {
ok(false, "Some test failed with error " + e);
SimpleTest.finish();
});
}
SimpleTest.waitForExplicitFinish();
+
+// 'network.predictor.enabled' is disabled because if other testcase load
+// evil.js, evil.css ...etc resources, it may cause we load them from cache
+// directly and bypass classifier check
SpecialPowers.pushPrefEnv({"set": [
- ["browser.safebrowsing.malware.enabled", true]
+ ["browser.safebrowsing.malware.enabled", true],
+ ["network.predictor.enabled", false],
]}, runTest);
</script>
</pre>
</body>
</html>
--- a/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
@@ -135,16 +135,21 @@ function runTest() {
SimpleTest.finish();
}).catch(function(e) {
ok(false, "Some test failed with error " + e);
SimpleTest.finish();
});
}
SimpleTest.waitForExplicitFinish();
+
+// 'network.predictor.enabled' is disabled because if other testcase load
+// evil.js, evil.css ...etc resources, it may cause we load them from cache
+// directly and bypass classifier check
SpecialPowers.pushPrefEnv({"set": [
- ["browser.safebrowsing.malware.enabled", true]
+ ["browser.safebrowsing.malware.enabled", true],
+ ["network.predictor.enabled", false],
]}, runTest);
</script>
</pre>
</body>
</html>