tor-browser

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

test_credman_empty_option.html (1255B)


      1 <!DOCTYPE html>
      2 <head>
      3  <title>Credential Management: Handle requests with empty options</title>
      4  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      5  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      6  <meta charset=utf-8>
      7 </head>
      8 <body>
      9 <h1>Credential Management: Handle requests with empty options</h1>
     10 
     11 <script class="testbody" type="text/javascript">
     12 "use strict";
     13 
     14 SimpleTest.waitForExplicitFinish();
     15 
     16 SpecialPowers.pushPrefEnv({"set": [["security.webauth.webauthn", true],
     17                                   ["dom.security.credentialmanagement.enabled", true]
     18                                 ]},
     19 async function() {
     20  info("testing create({}).")
     21  try {
     22    await navigator.credentials.create({});
     23    ok(false, "Credential creation with no options should be an error.");
     24  }
     25  catch (err) {
     26    is(err.name, "NotSupportedError", "Credential creation with no options is a NotSupportedError");
     27  }
     28  info("testing get({}).")
     29  try {
     30    await navigator.credentials.get({});
     31    ok(false, "Credential get with no options should be an error.");
     32  }
     33  catch (err) {
     34    is(err.name, "NotSupportedError", "Credential get with no options is a NotSupportedError");
     35  }
     36  SimpleTest.finish();
     37 });
     38 </script>
     39 </body>
     40 </html>