summaryrefslogtreecommitdiffstats
path: root/dom/credentialmanagement/identity/tests/mochitest/test_delay_reject.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /dom/credentialmanagement/identity/tests/mochitest/test_delay_reject.html
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/credentialmanagement/identity/tests/mochitest/test_delay_reject.html')
-rw-r--r--dom/credentialmanagement/identity/tests/mochitest/test_delay_reject.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/dom/credentialmanagement/identity/tests/mochitest/test_delay_reject.html b/dom/credentialmanagement/identity/tests/mochitest/test_delay_reject.html
new file mode 100644
index 0000000000..0151f4b6c4
--- /dev/null
+++ b/dom/credentialmanagement/identity/tests/mochitest/test_delay_reject.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Delay Reject</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <script src="head.js"></script>
+ <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
+ <script>
+ SimpleTest.waitForExplicitFinish();
+
+ SpecialPowers.pushPrefEnv({ set: [
+ ["dom.security.credentialmanagement.identity.reject_delay.enabled", "true" ],
+ ["dom.security.credentialmanagement.identity.reject_delay.duration_ms", "1000" ],
+ ] })
+ .then(() => {setupTest("delay_reject")})
+ .then(
+ function () {
+ return navigator.credentials.get({
+ identity: {
+ providers: []
+ }
+ });
+ }
+ ).then((cred) => {
+ ok(false, "incorrectly got a credential");
+ }).catch((err) => {
+ ok(true, "correctly got an error");
+ }).finally(() => {
+ SimpleTest.finish();
+ })
+ </script>
+</head>
+<body>
+<p id="display"></p>
+<div id="content" style="display: none">This test verifies that our rejections are delayed, checking for >500ms.</div>
+<pre id="test"></pre>
+</body>
+</html>