tor-browser

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

test_account_label.html (1636B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Happypath Test</title>
      6  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      7  <script src="head.js"></script>
      8  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
      9  <script>
     10    SimpleTest.waitForExplicitFinish();
     11    setupTest("account_label", "https://test1.example.com").then(
     12      function () {
     13        SpecialPowers.wrap(document).notifyUserGestureActivation();
     14        return navigator.credentials.get({
     15          identity: {
     16            mode: "active",
     17            providers: [{
     18              configURL: "https://test1.example.com/tests/dom/credentialmanagement/identity/tests/mochitest/server_manifest_account_label.sjs",
     19              clientId: "mochitest",
     20              nonce: "nonce"
     21            }]
     22          }
     23        });
     24      }
     25    ).then((cred) => {
     26      ok(true, "successfully got a credential");
     27      is(cred.token,
     28        "account_id=1234&client_id=mochitest&nonce=nonce&disclosure_text_shown=false&is_auto_selected=false",
     29        "Correct token on the credential.");
     30      is(cred.id,
     31        "1234",
     32        "Correct id on the credential");
     33      is(cred.type,
     34        "identity",
     35        "Correct type on the credential");
     36    }).catch(() => {
     37      ok(false, "must not have an error");
     38    }).finally(() => {
     39      SimpleTest.finish();
     40    })
     41  </script>
     42 </head>
     43 <body>
     44 <p id="display"></p>
     45 <div id="content" style="display: none">This is the main happypath test. We get a credential in a way that should work. This includes simplifying some logic like exactly one account and provider.</div>
     46 <pre id="test"></pre>
     47 </body>
     48 </html>