Revision 36857c5f01b941752b8877902dccd8b7b01202be authored by Tooru Fujisawa on 02 October 2018, 08:23:59 UTC, committed by moz-wptsync-bot on 02 October 2018, 08:23:59 UTC
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1495601
gecko-commit: 6568853848ac62384a094e521965e101978b1f62
gecko-integration-branch: mozilla-inbound
gecko-reviewers: sfink
1 parent b7fcdf3
Raw File
getcredential-passing.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>WebAuthn credential.get() Passing Tests</title>
<link rel="author" title="Adam Powers" href="mailto:adam@fidoalliance.org">
<link rel="help" href="https://w3c.github.io/webauthn/#iface-credential">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=helpers.js></script>
<body></body>
<script>
standardSetup(function() {
    "use strict";

    var credPromise = createCredential();

    // GetCredentialsTest with default args
    new GetCredentialsTest()
        .addCredential(credPromise)
        .runTest("passing credentials.get() with default args");

    // timeout
    new GetCredentialsTest({path: "options.publicKey.timeout", value: undefined})
        .addCredential(credPromise)
        .runTest("passing credentials.create() with no timeout");

    // rpId
    new GetCredentialsTest({path: "options.publicKey.rpId", value: undefined})
        .addCredential(credPromise)
        .runTest("rpId undefined");
    new GetCredentialsTest({path: "options.publicKey.rpId", value: window.location.host})
        .addCredential(credPromise)
        .runTest("passing credentials.get() with rpId (host and port)");
    new GetCredentialsTest({path: "options.publicKey.rpId", value: window.location.hostname})
        .addCredential(credPromise)
        .runTest("passing credentials.get() with rpId (hostname)");

    // allowCredentials
    new GetCredentialsTest({path: "options.publicKey.allowCredentials", value: undefined})
        .runTest("no credential specified");

    // authnr selection user verification
    new GetCredentialsTest({path: "options.publicKey.userVerification", value: undefined})
        .addCredential(credPromise)
        .runTest("authenticatorSelection userVerification undefined");
    new GetCredentialsTest("options.publicKey.userVerification", "preferred")
        .addCredential(credPromise)
        .runTest("authenticatorSelection userVerification preferred");
    new GetCredentialsTest("options.publicKey.userVerification", "discouraged")
        .addCredential(credPromise)
        .runTest("authenticatorSelection userVerification discouraged");

    // good extension values
    new GetCredentialsTest({path: "options.publicKey.extensions", value: undefined})
        .addCredential(credPromise)
        .runTest("extensions undefined");
    new GetCredentialsTest("options.publicKey.extensions", {})
        .addCredential(credPromise)
        .runTest("extensions are empty object");
    new GetCredentialsTest("options.publicKey.extensions", {foo: "", bar: "", bat: ""})
        .addCredential(credPromise)
        .runTest("extensions are dict of empty strings");
});

/* JSHINT */
/* globals standardSetup, GetCredentialsTest, createCredential */
</script>
back to top