tor-browser

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

test_idtoken_error.html (1203B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Server Error On Token Endpoint</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("idtoken_error").then(
     12      function () {
     13        SpecialPowers.wrap(document).notifyUserGestureActivation();
     14        return navigator.credentials.get({
     15          identity: {
     16            mode: "active",
     17            providers: [{
     18              configURL: "https://example.net/tests/dom/credentialmanagement/identity/tests/mochitest/server_manifest.sjs",
     19              clientId: "mochitest",
     20              nonce: "nonce"
     21            }]
     22          }
     23        });
     24      }
     25    ).then(() => {
     26      ok(false, "incorrectly got a credential");
     27    }).catch(() => {
     28      ok(true, "correctly got an error");
     29    }).finally(() => {
     30      SimpleTest.finish();
     31    })
     32  </script>
     33 </head>
     34 <body>
     35 <p id="display"></p>
     36 <div id="content" style="display: none">This test verifies that we do not get a credential when the idtoken endpoint returns an error.</div>
     37 <pre id="test"></pre>
     38 </body>
     39 </html>