diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /browser/components/resistfingerprinting/test/mochitest/test_bug863246_resource_uri.html | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/resistfingerprinting/test/mochitest/test_bug863246_resource_uri.html')
-rw-r--r-- | browser/components/resistfingerprinting/test/mochitest/test_bug863246_resource_uri.html | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/browser/components/resistfingerprinting/test/mochitest/test_bug863246_resource_uri.html b/browser/components/resistfingerprinting/test/mochitest/test_bug863246_resource_uri.html new file mode 100644 index 0000000000..fda1c04200 --- /dev/null +++ b/browser/components/resistfingerprinting/test/mochitest/test_bug863246_resource_uri.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<meta charset="utf8"> +<script src="/tests/SimpleTest/SimpleTest.js"></script> +<script> +/* global SimpleTest SpecialPowers add_task */ + +function testResourceUri(aTest, aUri, aContentAccessible) { + return new Promise((aResolve) => { + let link = document.createElement("link"); + link.rel = "stylesheet"; + link.onload = () => { + SimpleTest.ok(aContentAccessible, aTest); + aResolve(); + }; + link.onerror = () => { + SimpleTest.ok(!aContentAccessible, aTest); + aResolve(); + }; + link.href = aUri; + document.head.appendChild(link); + }); +} + +add_task(async function() { + await testResourceUri( + "resource://content-accessible is content-accessible", + "resource://content-accessible/viewsource.css", + true); + await testResourceUri( + "resource://gre-resources is not content-accessible", + "resource://gre-resources/html.css", + false); + await SpecialPowers.pushPrefEnv({ + set: [ + ["security.all_resource_uri_content_accessible", true], + ], + }); + await testResourceUri( + "security.all_resource_uri_content_accessible = true, resource://gre-resources is now content-accessible", + "resource://gre-resources/html.css", + true); +}); +</script> |