From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- netwerk/test/mochitests/empty.html | 16 + .../mochitests/file_loadinfo_redirectchain.sjs | 106 ++++++ netwerk/test/mochitests/method.sjs | 12 + netwerk/test/mochitests/mochitest.ini | 26 ++ netwerk/test/mochitests/partial_content.sjs | 151 +++++++++ netwerk/test/mochitests/redirect.sjs | 8 + netwerk/test/mochitests/redirect_idn.html | 0 netwerk/test/mochitests/redirect_idn.html^headers^ | 3 + netwerk/test/mochitests/rel_preconnect.sjs | 15 + .../test/mochitests/signed_web_packaged_app.sjs | 78 +++++ .../mochitests/test_arraybufferinputstream.html | 89 +++++ netwerk/test/mochitests/test_idn_redirect.html | 36 ++ .../mochitests/test_loadinfo_redirectchain.html | 213 ++++++++++++ .../mochitests/test_partially_cached_content.html | 92 +++++ netwerk/test/mochitests/test_redirect_ref.html | 30 ++ netwerk/test/mochitests/test_rel_preconnect.html | 62 ++++ netwerk/test/mochitests/test_uri_scheme.html | 51 +++ .../test/mochitests/test_user_agent_overrides.html | 240 ++++++++++++++ .../test/mochitests/test_user_agent_updates.html | 369 +++++++++++++++++++++ .../mochitests/test_user_agent_updates_reset.html | 44 +++ .../mochitests/test_viewsource_unlinkable.html | 27 ++ netwerk/test/mochitests/test_xhr_method_case.html | 66 ++++ netwerk/test/mochitests/user_agent.sjs | 21 ++ netwerk/test/mochitests/user_agent_update.sjs | 10 + netwerk/test/mochitests/web_packaged_app.sjs | 35 ++ 25 files changed, 1800 insertions(+) create mode 100644 netwerk/test/mochitests/empty.html create mode 100644 netwerk/test/mochitests/file_loadinfo_redirectchain.sjs create mode 100644 netwerk/test/mochitests/method.sjs create mode 100644 netwerk/test/mochitests/mochitest.ini create mode 100644 netwerk/test/mochitests/partial_content.sjs create mode 100644 netwerk/test/mochitests/redirect.sjs create mode 100644 netwerk/test/mochitests/redirect_idn.html create mode 100644 netwerk/test/mochitests/redirect_idn.html^headers^ create mode 100644 netwerk/test/mochitests/rel_preconnect.sjs create mode 100644 netwerk/test/mochitests/signed_web_packaged_app.sjs create mode 100644 netwerk/test/mochitests/test_arraybufferinputstream.html create mode 100644 netwerk/test/mochitests/test_idn_redirect.html create mode 100644 netwerk/test/mochitests/test_loadinfo_redirectchain.html create mode 100644 netwerk/test/mochitests/test_partially_cached_content.html create mode 100644 netwerk/test/mochitests/test_redirect_ref.html create mode 100644 netwerk/test/mochitests/test_rel_preconnect.html create mode 100644 netwerk/test/mochitests/test_uri_scheme.html create mode 100644 netwerk/test/mochitests/test_user_agent_overrides.html create mode 100644 netwerk/test/mochitests/test_user_agent_updates.html create mode 100644 netwerk/test/mochitests/test_user_agent_updates_reset.html create mode 100644 netwerk/test/mochitests/test_viewsource_unlinkable.html create mode 100644 netwerk/test/mochitests/test_xhr_method_case.html create mode 100644 netwerk/test/mochitests/user_agent.sjs create mode 100644 netwerk/test/mochitests/user_agent_update.sjs create mode 100644 netwerk/test/mochitests/web_packaged_app.sjs (limited to 'netwerk/test/mochitests') diff --git a/netwerk/test/mochitests/empty.html b/netwerk/test/mochitests/empty.html new file mode 100644 index 000000000..e60f5abdf --- /dev/null +++ b/netwerk/test/mochitests/empty.html @@ -0,0 +1,16 @@ + + + + + + + + + + This page does nothing. If the loading page managed to load this, the test + probably succeeded. + + diff --git a/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs b/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs new file mode 100644 index 000000000..88cacbdb9 --- /dev/null +++ b/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs @@ -0,0 +1,106 @@ +/* + * Redirect handler specifically for the needs of: + * Bug 1194052 - Append Principal to RedirectChain within LoadInfo before the channel is succesfully openend + */ + +function createIframeContent(aQuery) { + + var content =` + + + + Bug 1194052 - LoadInfo redirect chain subtest + + + + + `; + + return content; +} + +function handleRequest(request, response) +{ + response.setHeader("Cache-Control", "no-cache", false); + var queryString = request.queryString; + + if (queryString == "iframe-redir-https-2" || + queryString == "iframe-redir-err-2") { + var query = queryString.replace("iframe-", ""); + // send upgrade-insecure-requests CSP header + response.setHeader("Content-Type", "text/html", false); + response.setHeader("Content-Security-Policy", "upgrade-insecure-requests", false); + response.write(createIframeContent(query)); + return; + } + + // at the end of the redirectchain we return some text + // for sanity checking + if (queryString == "redir-0" || + queryString == "redir-https-0") { + response.setHeader("Content-Type", "text/html", false); + response.write("checking redirectchain"); + return; + } + + // special case redir-err-1 and return an error to trigger the fallback + if (queryString == "redir-err-1") { + response.setStatusLine("1.1", 404, "Bad request"); + return; + } + + // must be a redirect + var newLoaction = ""; + switch (queryString) { + case "redir-err-2": + newLocation = + "http://example.com/tests/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs?redir-err-1"; + break; + + case "redir-https-2": + newLocation = + "http://example.com/tests/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs?redir-https-1"; + break; + + case "redir-https-1": + newLocation = + "http://example.com/tests/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs?redir-https-0"; + break; + + case "redir-2": + newLocation = + "http://mochi.test:8888/tests/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs?redir-1"; + break; + + case "redir-1": + newLocation = + "http://mochi.test:8888/tests/netwerk/test/mochitests/file_loadinfo_redirectchain.sjs?redir-0"; + break; + } + + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", newLocation, false); +} diff --git a/netwerk/test/mochitests/method.sjs b/netwerk/test/mochitests/method.sjs new file mode 100644 index 000000000..386c15d79 --- /dev/null +++ b/netwerk/test/mochitests/method.sjs @@ -0,0 +1,12 @@ + +function handleRequest(request, response) +{ + // avoid confusing cache behaviors + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/plain", false); + response.setHeader("Access-Control-Allow-Origin", "*", false); + + // echo method + response.write(request.method); +} + diff --git a/netwerk/test/mochitests/mochitest.ini b/netwerk/test/mochitests/mochitest.ini new file mode 100644 index 000000000..98d406c80 --- /dev/null +++ b/netwerk/test/mochitests/mochitest.ini @@ -0,0 +1,26 @@ +[DEFAULT] +support-files = + method.sjs + partial_content.sjs + rel_preconnect.sjs + user_agent.sjs + user_agent_update.sjs + web_packaged_app.sjs + file_loadinfo_redirectchain.sjs + redirect_idn.html^headers^ + redirect_idn.html + empty.html + redirect.sjs + +[test_arraybufferinputstream.html] +[test_idn_redirect.html] +[test_loadinfo_redirectchain.html] +[test_partially_cached_content.html] +[test_rel_preconnect.html] +[test_redirect_ref.html] +[test_uri_scheme.html] +[test_user_agent_overrides.html] +[test_user_agent_updates.html] +[test_user_agent_updates_reset.html] +[test_viewsource_unlinkable.html] +[test_xhr_method_case.html] diff --git a/netwerk/test/mochitests/partial_content.sjs b/netwerk/test/mochitests/partial_content.sjs new file mode 100644 index 000000000..5fd3443f1 --- /dev/null +++ b/netwerk/test/mochitests/partial_content.sjs @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Debug and Error wrapper functions for dump(). + */ +function ERR(response, responseCode, responseCodeStr, msg) +{ + // Reset state var. + setState("expectedRequestType", ""); + // Dump to console log and send to client in response. + dump("SERVER ERROR: " + msg + "\n"); + response.write("HTTP/1.1 " + responseCode + " " + responseCodeStr + "\r\n"); + response.write("Content-Type: text/html; charset=UTF-8\r\n"); + response.write("Content-Length: " + msg.length + "\r\n"); + response.write("\r\n"); + response.write(msg); +} + +function DBG(msg) +{ + // Dump to console only. + dump("SERVER DEBUG: " + msg + "\n"); +} + +/* Delivers content in parts to test partially cached content: requires two + * requests for the same resource. + * + * First call will respond with partial content, but a 200 header and + * Content-Length equal to the full content length. No Range or If-Range + * headers are allowed in the request. + * + * Second call will require Range and If-Range in the request headers, and + * will respond with the range requested. + */ +function handleRequest(request, response) +{ + DBG("Trying to seize power"); + response.seizePower(); + + DBG("About to check state vars"); + // Get state var to determine if this is the first or second request. + var expectedRequestType; + var lastModified; + if (getState("expectedRequestType") === "") { + DBG("First call: Should be requesting full content."); + expectedRequestType = "fullRequest"; + // Set state var for second request. + setState("expectedRequestType", "partialRequest"); + // Create lastModified variable for responses. + lastModified = (new Date()).toUTCString(); + setState("lastModified", lastModified); + } else if (getState("expectedRequestType") === "partialRequest") { + DBG("Second call: Should be requesting undelivered content."); + expectedRequestType = "partialRequest"; + // Reset state var for first request. + setState("expectedRequestType", ""); + // Get last modified date and reset state var. + lastModified = getState("lastModified"); + } else { + ERR(response, 500, "Internal Server Error", + "Invalid expectedRequestType \"" + expectedRequestType + "\"in " + + "server state db."); + return; + } + + // Look for Range and If-Range + var range = request.hasHeader("Range") ? request.getHeader("Range") : ""; + var ifRange = request.hasHeader("If-Range") ? request.getHeader("If-Range") : ""; + + if (expectedRequestType === "fullRequest") { + // Should not have Range or If-Range in first request. + if (range && range.length > 0) { + ERR(response, 400, "Bad Request", + "Should not receive \"Range: " + range + "\" for first, full request."); + return; + } + if (ifRange && ifRange.length > 0) { + ERR(response, 400, "Bad Request", + "Should not receive \"Range: " + range + "\" for first, full request."); + return; + } + } else if (expectedRequestType === "partialRequest") { + // Range AND If-Range should both be present in second request. + if (!range) { + ERR(response, 400, "Bad Request", + "Should receive \"Range: \" for second, partial request."); + return; + } + if (!ifRange) { + ERR(response, 400, "Bad Request", + "Should receive \"If-Range: \" for second, partial request."); + return; + } + } else { + // Somewhat redundant, but a check for errors in this test code. + ERR(response, 500, "Internal Server Error", + "expectedRequestType not set correctly: \"" + expectedRequestType + "\""); + return; + } + + // Prepare content in two parts for responses. + var partialContent = "

" + + "First response

"; + var remainderContent = "

Second response

" + + ""; + var totalLength = partialContent.length + remainderContent.length; + + DBG("totalLength: " + totalLength); + + // Prepare common headers for the two responses. + date = new Date(); + DBG("Date: " + date.toUTCString() + ", Last-Modified: " + lastModified); + var commonHeaders = "Date: " + date.toUTCString() + "\r\n" + + "Last-Modified: " + lastModified + "\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n" + + "ETag: abcd0123\r\n" + + "Accept-Ranges: bytes\r\n"; + + + // Prepare specific headers and content for first and second responses. + if (expectedRequestType === "fullRequest") { + DBG("First response: Sending partial content with a full header"); + response.write("HTTP/1.1 200 OK\r\n"); + response.write(commonHeaders); + // Set Content-Length to full length of resource. + response.write("Content-Length: " + totalLength + "\r\n"); + response.write("\r\n"); + response.write(partialContent); + } else if (expectedRequestType === "partialRequest") { + DBG("Second response: Sending remaining content with a range header"); + response.write("HTTP/1.1 206 Partial Content\r\n"); + response.write(commonHeaders); + // Set Content-Length to length of bytes transmitted. + response.write("Content-Length: " + remainderContent.length + "\r\n"); + response.write("Content-Range: bytes " + partialContent.length + "-" + + (totalLength - 1) + "/" + totalLength + "\r\n"); + response.write("\r\n"); + response.write(remainderContent); + } else { + // Somewhat redundant, but a check for errors in this test code. + ERR(response, 500, "Internal Server Error", + "Something very bad happened here: expectedRequestType is invalid " + + "towards the end of handleRequest! - \"" + expectedRequestType + "\""); + return; + } + + response.finish(); +} diff --git a/netwerk/test/mochitests/redirect.sjs b/netwerk/test/mochitests/redirect.sjs new file mode 100644 index 000000000..e36f7c99a --- /dev/null +++ b/netwerk/test/mochitests/redirect.sjs @@ -0,0 +1,8 @@ +var Cc = Components.classes; +var Ci = Components.interfaces; +var Cu = Components.utils; + +function handleRequest(request, response) { + response.setStatusLine(request.httpVersion, 301, "Moved Permanently"); + response.setHeader("Location", "empty.html#"); +} diff --git a/netwerk/test/mochitests/redirect_idn.html b/netwerk/test/mochitests/redirect_idn.html new file mode 100644 index 000000000..e69de29bb diff --git a/netwerk/test/mochitests/redirect_idn.html^headers^ b/netwerk/test/mochitests/redirect_idn.html^headers^ new file mode 100644 index 000000000..753f65db8 --- /dev/null +++ b/netwerk/test/mochitests/redirect_idn.html^headers^ @@ -0,0 +1,3 @@ +HTTP 301 Moved Permanently +Location: http://exämple.test/tests/netwerk/test/mochitests/empty.html +X-Comment: Bug 1142083 - This is a redirect to http://exämple.test diff --git a/netwerk/test/mochitests/rel_preconnect.sjs b/netwerk/test/mochitests/rel_preconnect.sjs new file mode 100644 index 000000000..9b5f5a69c --- /dev/null +++ b/netwerk/test/mochitests/rel_preconnect.sjs @@ -0,0 +1,15 @@ +// Generate response header "Link: ; rel=preconnect" +// HREF is provided by the request header X-Link + +function handleRequest(request, response) +{ + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Link", "<" + + request.queryString + + ">; rel=preconnect" + ", " + + "<" + + request.queryString + + ">; rel=preconnect; crossOrigin=anonymous"); + response.write("check that header"); +} + diff --git a/netwerk/test/mochitests/signed_web_packaged_app.sjs b/netwerk/test/mochitests/signed_web_packaged_app.sjs new file mode 100644 index 000000000..6bcac6ffd --- /dev/null +++ b/netwerk/test/mochitests/signed_web_packaged_app.sjs @@ -0,0 +1,78 @@ +var Cc = Components.classes; +var Ci = Components.interfaces; +var Cu = Components.utils; + +function handleRequest(request, response) +{ + response.setHeader("Content-Type", "application/package", false); + response.write(signedPackage); +} + +// The package content +// getData formats it as described at http://www.w3.org/TR/web-packaging/#streamable-package-format +var signedPackage = `manifest-signature: MIIF1AYJKoZIhvcNAQcCoIIFxTCCBcECAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCCA54wggOaMIICgqADAgECAgEEMA0GCSqGSIb3DQEBCwUAMHMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEkMCIGA1UEChMbRXhhbXBsZSBUcnVzdGVkIENvcnBvcmF0aW9uMRkwFwYDVQQDExBUcnVzdGVkIFZhbGlkIENBMB4XDTE1MTExOTAzMDEwNVoXDTM1MTExOTAzMDEwNVowdDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MSQwIgYDVQQKExtFeGFtcGxlIFRydXN0ZWQgQ29ycG9yYXRpb24xGjAYBgNVBAMTEVRydXN0ZWQgQ29ycCBDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPback9X7RRxKTc3/5o2vm9Ro6XNiSM9NPsN3djjCIVz50bY0rJkP98zsqpFjnLwqHeJigxyYoqFexRhRLgKrG10CxNl4rxP6CEPENjvj5FfbX/HUZpT/DelNR18F498yD95vSHcSrCc3JrjV3bKA+wgt11E4a0Ba95S1RuwtehZw1+Y4hO8nHpbSGfjD0BpluFY2nDoYAm+aWSrsmLuJsKLO8Xn2I1brZFJUynR3q1ujuDE9EJk1niDLfOeVgXM4AavJS5C0ZBHhAhR2W+K9NN97jpkpmHFqecTwDXB7rEhsyB3185cI7anaaQfHHfH5+4SD+cMDNtYIOSgLO06ZwIDAQABozgwNjAMBgNVHRMBAf8EAjAAMBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMDMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0BAQsFAAOCAQEAlnVyLz5dPhS0ZhZD6qJOUzSo6nFwMxNX1m0oS37mevtuh0b0o1gmEuMw3mVxiAVkC2vPsoxBL2wLlAkcEdBPxGEqhBmtiBY3F3DgvEkf+/sOY1rnr6O1qLZuBAnPzA1Vnco8Jwf0DYF0PxaRd8yT5XSl5qGpM2DItEldZwuKKaL94UEgIeC2c+Uv/IOyrv+EyftX96vcmRwr8ghPFLQ+36H5nuAKEpDD170EvfWl1zs0dUPiqSI6l+hy5V14gl63Woi34L727+FKx8oatbyZtdvbeeOmenfTLifLomnZdx+3WMLkp3TLlHa5xDLwifvZtBP2d3c6zHp7gdrGU1u2WTGCAf4wggH6AgEBMHgwczELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MSQwIgYDVQQKExtFeGFtcGxlIFRydXN0ZWQgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFRydXN0ZWQgVmFsaWQgQ0ECAQQwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE1MTEyNTAzMDQzMFowIwYJKoZIhvcNAQkEMRYEFD4ut4oKoYdcGzyfQE6ROeazv+uNMA0GCSqGSIb3DQEBAQUABIIBAFG99dKBSOzQmYVn6lHKWERVDtYXbDTIVF957ID8YH9B5unlX/PdludTNbP5dzn8GWQV08tNRgoXQ5sgxjifHunrpaR1WiR6XqvwOCBeA5NB688jxGNxth6zg6fCGFaynsYMX3FlglfIW+AYwyQUclbv+C4UORJpBjvuknOnK+UDBLVSoP9ivL6KhylYna3oFcs0SMsumc/jf/oQW51LzFHpn61TRUqdDgvGhwcjgphMhKj23KwkjwRspU2oIWNRAuhZgqDD5BJlNniCr9X5Hx1dW6tIVISO91CLAryYkGZKRJYekXctCpIvldUkIDeh2tAw5owr0jtsVd6ovFF3bV4=\r +--NKWXJUAFXB\r +Content-Location: manifest.webapp\r +Content-Type: application/x-web-app-manifest+json\r +\r +{ + "moz-package-origin": "http://mochi.test:8888", + "name": "My App", + "moz-resources": [ + { + "src": "page2.html", + "integrity": "JREF3JbXGvZ+I1KHtoz3f46ZkeIPrvXtG4VyFQrJ7II=" + }, + { + "src": "index.html", + "integrity": "Jkvco7U8WOY9s0YREsPouX+DWK7FWlgZwA0iYYSrb7Q=" + }, + { + "src": "scripts/script.js", + "integrity": "6TqtNArQKrrsXEQWu3D9ZD8xvDRIkhyV6zVdTcmsT5Q=" + }, + { + "src": "scripts/library.js", + "integrity": "TN2ByXZiaBiBCvS4MeZ02UyNi44vED+KjdjLInUl4o8=" + } + ], + "moz-permissions": [ + { + "systemXHR": { + "description": "Needed to download stuff" + } + } + ], + "package-identifier": "09bc9714-7ab6-4320-9d20-fde4c237522c", + "description": "A great app!" +}\r +--NKWXJUAFXB\r +Content-Location: page2.html\r +Content-Type: text/html\r +\r + + page2.html + +\r +--NKWXJUAFXB\r +Content-Location: index.html\r +Content-Type: text/html\r +\r + + Last updated: 2015/10/28 + + +\r +--NKWXJUAFXB\r +Content-Location: scripts/script.js\r +Content-Type: text/javascript\r +\r +// script.js +\r +--NKWXJUAFXB\r +Content-Location: scripts/library.js\r +Content-Type: text/javascript\r +\r +// library.js +\r +--NKWXJUAFXB--`; diff --git a/netwerk/test/mochitests/test_arraybufferinputstream.html b/netwerk/test/mochitests/test_arraybufferinputstream.html new file mode 100644 index 000000000..eb7796ef2 --- /dev/null +++ b/netwerk/test/mochitests/test_arraybufferinputstream.html @@ -0,0 +1,89 @@ + + + + + ArrayBuffer stream test + + + + + + +

+ +
+
+ + diff --git a/netwerk/test/mochitests/test_idn_redirect.html b/netwerk/test/mochitests/test_idn_redirect.html new file mode 100644 index 000000000..b9a594cc5 --- /dev/null +++ b/netwerk/test/mochitests/test_idn_redirect.html @@ -0,0 +1,36 @@ + + + + + Test for URI Manipulation + + + + + +
+
+
+
+
+
diff --git a/netwerk/test/mochitests/test_loadinfo_redirectchain.html b/netwerk/test/mochitests/test_loadinfo_redirectchain.html
new file mode 100644
index 000000000..4568db0c2
--- /dev/null
+++ b/netwerk/test/mochitests/test_loadinfo_redirectchain.html
@@ -0,0 +1,213 @@
+
+
+
+  Bug 1194052 - Append Principal to RedirectChain within LoadInfo before the channel is succesfully openend
+  
+  
+  
+
+
+
+
+
+
+
diff --git a/netwerk/test/mochitests/test_partially_cached_content.html b/netwerk/test/mochitests/test_partially_cached_content.html
new file mode 100644
index 000000000..65a56dfe5
--- /dev/null
+++ b/netwerk/test/mochitests/test_partially_cached_content.html
@@ -0,0 +1,92 @@
+
+
+
+
+  
+  Test for Bug 497003: support sending OnDataAvailable() to other threads
+  
+  
+
+
+  

Mozilla Bug 497003: support sending OnDataAvailable() to other threads

+

+ +
+
+
+ + diff --git a/netwerk/test/mochitests/test_redirect_ref.html b/netwerk/test/mochitests/test_redirect_ref.html new file mode 100644 index 000000000..40ea16658 --- /dev/null +++ b/netwerk/test/mochitests/test_redirect_ref.html @@ -0,0 +1,30 @@ + + + + Bug 1234575 - Test redirect ref + + + + + +
+
+
+
+
+
diff --git a/netwerk/test/mochitests/test_rel_preconnect.html b/netwerk/test/mochitests/test_rel_preconnect.html
new file mode 100644
index 000000000..4e94fb4ce
--- /dev/null
+++ b/netwerk/test/mochitests/test_rel_preconnect.html
@@ -0,0 +1,62 @@
+
+
+
+
+  Test for link rel=preconnect
+  
+  
+
+
+
+
+

+ +
+
+ + + diff --git a/netwerk/test/mochitests/test_uri_scheme.html b/netwerk/test/mochitests/test_uri_scheme.html new file mode 100644 index 000000000..1f01a4d0a --- /dev/null +++ b/netwerk/test/mochitests/test_uri_scheme.html @@ -0,0 +1,51 @@ + + + + + Test for URI Manipulation + + + + + + +

+ +
+
+ + + diff --git a/netwerk/test/mochitests/test_user_agent_overrides.html b/netwerk/test/mochitests/test_user_agent_overrides.html new file mode 100644 index 000000000..7396c35e1 --- /dev/null +++ b/netwerk/test/mochitests/test_user_agent_overrides.html @@ -0,0 +1,240 @@ + + + + + Test for User Agent Overrides + + + + +Mozilla Bug 782453 +

+ +
+
+
+ + diff --git a/netwerk/test/mochitests/test_user_agent_updates.html b/netwerk/test/mochitests/test_user_agent_updates.html new file mode 100644 index 000000000..839f9e000 --- /dev/null +++ b/netwerk/test/mochitests/test_user_agent_updates.html @@ -0,0 +1,369 @@ + + + + + Test for User Agent Updates + + + + +Mozilla Bug 897221 +

+ +
+
+
+ + diff --git a/netwerk/test/mochitests/test_user_agent_updates_reset.html b/netwerk/test/mochitests/test_user_agent_updates_reset.html new file mode 100644 index 000000000..5b51fc40d --- /dev/null +++ b/netwerk/test/mochitests/test_user_agent_updates_reset.html @@ -0,0 +1,44 @@ + + + + + Test for Bug 942470 + + + + +Mozilla Bug 942470 +

+ +
+
+
+ + diff --git a/netwerk/test/mochitests/test_viewsource_unlinkable.html b/netwerk/test/mochitests/test_viewsource_unlinkable.html new file mode 100644 index 000000000..9a1a35d68 --- /dev/null +++ b/netwerk/test/mochitests/test_viewsource_unlinkable.html @@ -0,0 +1,27 @@ + + + + + Test for view-source linkability + + + + + + +

+ +
+
+ + + + diff --git a/netwerk/test/mochitests/test_xhr_method_case.html b/netwerk/test/mochitests/test_xhr_method_case.html new file mode 100644 index 000000000..236ab210b --- /dev/null +++ b/netwerk/test/mochitests/test_xhr_method_case.html @@ -0,0 +1,66 @@ + + + + + Test for XHR Method casing + + + + + + +

+ +
+
+ + + diff --git a/netwerk/test/mochitests/user_agent.sjs b/netwerk/test/mochitests/user_agent.sjs new file mode 100644 index 000000000..dea299a20 --- /dev/null +++ b/netwerk/test/mochitests/user_agent.sjs @@ -0,0 +1,21 @@ + +function handleRequest(request, response) +{ + // avoid confusing cache behaviors + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/html", false); + response.setHeader("Access-Control-Allow-Origin", "*", false); + + // used by test_user_agent tests + response.write( + "\ + \ + " + ); +} diff --git a/netwerk/test/mochitests/user_agent_update.sjs b/netwerk/test/mochitests/user_agent_update.sjs new file mode 100644 index 000000000..649ceb903 --- /dev/null +++ b/netwerk/test/mochitests/user_agent_update.sjs @@ -0,0 +1,10 @@ + +function handleRequest(request, response) +{ + // avoid confusing cache behaviors + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "application/json", false); + + // used by test_user_agent_updates test + response.write(decodeURIComponent(request.queryString)); +} diff --git a/netwerk/test/mochitests/web_packaged_app.sjs b/netwerk/test/mochitests/web_packaged_app.sjs new file mode 100644 index 000000000..d5587d8d7 --- /dev/null +++ b/netwerk/test/mochitests/web_packaged_app.sjs @@ -0,0 +1,35 @@ +var Cc = Components.classes; +var Ci = Components.interfaces; +var Cu = Components.utils; + +function handleRequest(request, response) +{ + response.setHeader("Content-Type", "application/package", false); + response.write(octetStreamData.getData()); + return; +} + +// The package content +// getData formats it as described at http://www.w3.org/TR/web-packaging/#streamable-package-format +var octetStreamData = { + content: [ + { headers: ["Content-Location: /index.html", "Content-Type: text/html"], data: "\r\n \r\n \r\n\r\n Web Packaged App Index\r\n\r\n", type: "text/html" }, + { headers: ["Content-Location: /scripts/app.js", "Content-Type: text/javascript"], data: "module Math from '/scripts/helpers/math.js';\r\n...\r\n", type: "text/javascript" }, + { headers: ["Content-Location: /scripts/helpers/math.js", "Content-Type: text/javascript"], data: "export function sum(nums) { ... }\r\n...\r\n", type: "text/javascript" } + ], + token : "gc0pJq0M:08jU534c0p", + getData: function() { + var str = ""; + for (var i in this.content) { + str += "--" + this.token + "\r\n"; + for (var j in this.content[i].headers) { + str += this.content[i].headers[j] + "\r\n"; + } + str += "\r\n"; + str += this.content[i].data + "\r\n"; + } + + str += "--" + this.token + "--"; + return str; + } +} -- cgit v1.2.3