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 /parser/htmlparser/tests/mochitest/test_base_csp_img.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'parser/htmlparser/tests/mochitest/test_base_csp_img.html')
-rw-r--r-- | parser/htmlparser/tests/mochitest/test_base_csp_img.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/parser/htmlparser/tests/mochitest/test_base_csp_img.html b/parser/htmlparser/tests/mochitest/test_base_csp_img.html new file mode 100644 index 0000000000..d17a99c657 --- /dev/null +++ b/parser/htmlparser/tests/mochitest/test_base_csp_img.html @@ -0,0 +1,35 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Base with base-uri CSP</title> + <script type="text/javascript" src="/MochiKit/MochiKit.js"></script> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> + + <!-- Set CSP --> + <meta http-equiv="Content-Security-Policy" content="base-uri 'self';"> + + <!-- Base should be ignored --> + <base href="http://example.org/"> +</head> +<body> + +<img src="/tests/parser/htmlparser/tests/mochitest/file_base_csp_img.sjs?image" width=10 height=10> + +<script> +add_task(async function() { + let response = await fetch( + "http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_base_csp_img.sjs?result" + ); + let hosts = await response.json(); + + is(hosts.length, 1, "One host"); + is(hosts[0], "mochi.test", "Host was not influenced by base"); + + info("finished"); +}); +</script> + +</body> +</html> + |