summaryrefslogtreecommitdiffstats
path: root/dom/base/test/test_bug1281963.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /dom/base/test/test_bug1281963.html
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.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 'dom/base/test/test_bug1281963.html')
-rw-r--r--dom/base/test/test_bug1281963.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/dom/base/test/test_bug1281963.html b/dom/base/test/test_bug1281963.html
new file mode 100644
index 0000000000..b2d48cc7ec
--- /dev/null
+++ b/dom/base/test/test_bug1281963.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/1281963
+-->
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>Test for Bug 1281963</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<p id="display"></p>
+<div id="content"></div>
+
+<script class="testbody" type="application/javascript">
+
+let pushPref = function(key, value) {
+ return SpecialPowers.pushPrefEnv({"set": [[key, value]]});
+};
+
+let popPref = function() {
+ SpecialPowers.popPrefEnv();
+};
+
+// Run a test to see that we don't hide the hard-coded mimeTypes
+// or plugins when "privacy.resistFingerprinting" is active.
+// See bug 1756280.
+add_task(async function() {
+ for (let rfpEnabled of [true, false]) {
+ await pushPref("privacy.resistFingerprinting", rfpEnabled);
+ for (let pdfDisabled of [true, false]) {
+ await pushPref("pdfjs.disabled", pdfDisabled);
+ if (pdfDisabled && !rfpEnabled) {
+ is(navigator.mimeTypes.length, 0, "navigator.mimeTypes.length should be 0");
+ is(navigator.plugins.length, 0, "navigator.plugins.length should 0");
+ } else {
+ let exampleMimeType = navigator.mimeTypes[0];
+ let examplePlugin = navigator.plugins[0];
+
+ isnot(navigator.mimeTypes[exampleMimeType.type], undefined, "Should reveal mime type");
+ is(navigator.mimeTypes.length, 2, "navigator.mimeTypes.length should be 2");
+
+ isnot(navigator.plugins[examplePlugin.name], undefined, "Should reveal plugin");
+ is(navigator.plugins.length, 5, "navigator.plugins.length should be nonzero");
+ }
+ await popPref();
+ }
+ await popPref();
+ }
+});
+
+</script>
+
+</body>
+</html>