diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/tests/mochitest/fetch/test_fetch_user_control_rp.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest/fetch/test_fetch_user_control_rp.html')
-rw-r--r-- | dom/tests/mochitest/fetch/test_fetch_user_control_rp.html | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/dom/tests/mochitest/fetch/test_fetch_user_control_rp.html b/dom/tests/mochitest/fetch/test_fetch_user_control_rp.html new file mode 100644 index 0000000000..67ad489191 --- /dev/null +++ b/dom/tests/mochitest/fetch/test_fetch_user_control_rp.html @@ -0,0 +1,103 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Test fetch user control referrer policy Bug 1304623</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + <script type="application/javascript"> + const SJS = "://example.com/tests/dom/base/test/referrer_testserver.sjs?"; + const PARAMS = ["SCHEME_FROM", "SCHEME_TO", "CROSS_ORIGIN"]; + + const testCases = [ + {ACTION: ["generate-fetch-user-control-policy-test"], + PREFS: [['network.http.referer.defaultPolicy', 0]], + TESTS: [ + // 0. No referrer. + {NAME: 'default-policy-value-no-referrer-https-http', + DESC: 'default-policy-value-no-referrer-https-http', + SCHEME_FROM: 'https', + SCHEME_TO: 'http', + RESULT: 'none'}, + {NAME: 'default-policy-value-no-referrer-https-https', + DESC: 'default-policy-value-no-referrer-https-https', + SCHEME_FROM: 'https', + SCHEME_TO: 'https', + RESULT: 'none'}], + }, + {ACTION: ["generate-fetch-user-control-policy-test"], + PREFS: [['network.http.referer.defaultPolicy', 1]], + TESTS: [ + // 1. Same origin. + {NAME: 'default-policy-value-same-origin-https-http', + DESC: 'default-policy-value-same-origin-https-http', + SCHEME_FROM: 'https', + SCHEME_TO: 'http', + RESULT: 'none'}, + {NAME: 'default-policy-value-same-origin-http-https', + DESC: 'default-policy-value-same-origin-http-https', + SCHEME_FROM: 'http', + SCHEME_TO: 'https', + RESULT: 'none'}, + {NAME: 'default-policy-value-same-origin-https-https', + DESC: 'default-policy-value-same-origin-https-https', + SCHEME_FROM: 'https', + SCHEME_TO: 'https', + RESULT: 'full'}], + }, + {ACTION: ["generate-fetch-user-control-policy-test"], + PREFS: [['network.http.referer.defaultPolicy', 2]], + TESTS: [ + // 2. strict-origin-when-cross-origin. + {NAME: 'default-policy-value-strict-origin-when-cross-origin-https-http', + DESC: 'default-policy-value-strict-origin-when-cross-origin-https-http', + SCHEME_FROM: 'https', + SCHEME_TO: 'http', + RESULT: 'none'}, + {NAME: 'default-policy-value-strict-origin-when-cross-origin-http-https', + DESC: 'default-policy-value-strict-origin-when-cross-origin-http-https', + SCHEME_FROM: 'http', + SCHEME_TO: 'https', + RESULT: 'origin'}, + {NAME: 'default-policy-value-strict-origin-when-cross-origin-https-https-same-origin', + DESC: 'default-policy-value-strict-origin-when-cross-origin-https-https-same-origin', + SCHEME_FROM: 'https', + SCHEME_TO: 'https', + RESULT: 'full'}, + {NAME: 'default-policy-value-strict-origin-when-cross-origin-https-https-cross-origin', + DESC: 'default-policy-value-strict-origin-when-cross-origin-https-https-cross-origin', + SCHEME_FROM: 'https', + SCHEME_TO: 'https', + CROSS_ORIGIN: 'true', + RESULT: 'origin'}], + }, + {ACTION: ["generate-fetch-user-control-policy-test"], + PREFS: [['network.http.referer.defaultPolicy', 3]], + TESTS: [ + // 3. Default no-referrer-when-downgrade. + {NAME: 'default-policy-value-no-referrer-when-downgrade-https-http', + DESC: 'default-policy-value-no-referrer-when-downgrade-https-http', + SCHEME_FROM: 'https', + SCHEME_TO: 'http', + RESULT: 'none'}, + {NAME: 'default-policy-value-no-referrer-when-downgrade-http-https', + DESC: 'default-policy-value-no-referrer-when-downgrade-http-https', + SCHEME_FROM: 'http', + SCHEME_TO: 'https', + RESULT: 'full'}, + {NAME: 'default-policy-value-no-referrer-when-downgrade-https-https', + DESC: 'default-policy-value-no-referrer-when-downgrade-https-https', + SCHEME_FROM: 'https', + SCHEME_TO: 'https', + RESULT: 'full'}], + }, + ]; + + </script> + <script type="application/javascript" src="/tests/dom/base/test/referrer_helper.js"></script> + +</head> +<body onload="tests.next();"> + <iframe id="testframe"></iframe> +</body> +</html> |