tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

digital-credential-user-agent-allows-protocol.https.html (789B)


      1 <!DOCTYPE html>
      2 <title>Tests for DigitalCredential's userAgentAllowsProtocol() static method.</title>
      3 <link rel="help" href="https://github.com/w3c-fedid/digital-credentials/pull/221" />
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 
      7 <body></body>
      8 <script type="module">
      9 
     10  const invalidIdentifiers = ["", " ", "a b", "a,b", "AB", "a.B", "a.b", " foo-bar", " foo-bar ", "foo-bar ", "fooBar"];
     11 
     12  promise_test(async (t) => {
     13    for (const invalidIdentifier of invalidIdentifiers) {
     14      const result = DigitalCredential.userAgentAllowsProtocol(invalidIdentifier);
     15      assert_equals(result, false, `Incorrect result for ${invalidIdentifier}.`);
     16    }
     17  }, "User agent does not allow invalid protocol identifiers.");
     18 
     19 </script>