Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /digital-credentials/digital-credential-user-agent-allows-protocol.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Tests for DigitalCredential's userAgentAllowsProtocol() static method.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body></body>
<script type="module">
const invalidIdentifiers = ["", " ", "a b", "a,b", "AB", "a.B", "a.b", " foo-bar", " foo-bar ", "foo-bar ", "fooBar"];
promise_test(async (t) => {
for (const invalidIdentifier of invalidIdentifiers) {
const result = DigitalCredential.userAgentAllowsProtocol(invalidIdentifier);
assert_equals(result, false, `Incorrect result for ${invalidIdentifier}.`);
}
}, "User agent does not allow invalid protocol identifiers.");
</script>