diff --git a/toolkit/components/url-classifier/tests/mochitest/appcache.html b/toolkit/components/url-classifier/tests/mochitest/appcache.html new file mode 100644 index 000000000000..b1dfcd174ab1 --- /dev/null +++ b/toolkit/components/url-classifier/tests/mochitest/appcache.html @@ -0,0 +1,25 @@ + + +classify manifest test + + + + +

+ + diff --git a/toolkit/components/url-classifier/tests/mochitest/cacheManifest.sjs b/toolkit/components/url-classifier/tests/mochitest/cacheManifest.sjs new file mode 100644 index 000000000000..dd06553c86c0 --- /dev/null +++ b/toolkit/components/url-classifier/tests/mochitest/cacheManifest.sjs @@ -0,0 +1,22 @@ +var manifest = + "CACHE MANIFEST\n" + +function handleRequest(request, response) +{ + var query = {}; + request.queryString.split('&').forEach(function (val) { + var [name, value] = val.split('='); + query[name] = unescape(value); + }); + + if (query["update"]) { + setState("update", "#" + Date.now() + "\n"); + } + var update = getState("update"); + + response.setStatusLine(request.httpVersion, 200, "Ok"); + response.setHeader("Content-Type", "text/cache-manifest"); + response.setHeader("Cache-Control", "no-cache"); + response.write(manifest); + response.write(update ? update : "#default\n"); +} diff --git a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini index 46d039829c98..9edc51b44757 100644 --- a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini +++ b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini @@ -18,8 +18,11 @@ support-files = whitelistFrame.html workerFrame.html ping.sjs + cacheManifest.sjs + appcache.html [test_classifier.html] skip-if = (os == 'linux' && debug) #Bug 1199778 [test_classifier_worker.html] +[test_classify_manifest.html] [test_classify_ping.html] diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classify_manifest.html b/toolkit/components/url-classifier/tests/mochitest/test_classify_manifest.html new file mode 100644 index 000000000000..39eb84ba6f46 --- /dev/null +++ b/toolkit/components/url-classifier/tests/mochitest/test_classify_manifest.html @@ -0,0 +1,139 @@ + + + + Bug 1262339 - Appcache manifest doesn't use URL classifier. + + + + + +

+ +
+
+
+
+ +