<!DOCTYPE html>
<html>
<head>
    <script src="/js-test-resources/js-test.js"></script>
    <script src="./resources/util.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
    description("Tests that PublicKeyCredential's [[create]] throws TypeError when invalid options are passed.");

    jsTestIsAsync = true;

    const rp = {
        name: "example.com"
    };
    const user = {
        name: "John Appleseed",
        id: asciiToUint8Array("123456"),
        displayName: "Appleseed"
    };
    const challenge = asciiToUint8Array("123456");
    const pubKeyCredParam = { type: "public-key", alg: -7 };
    const excludeCredentials = { type: "public-key", id: asciiToUint8Array("123456") };

    const missingAttributeVector = [
        // missing top level attribute
        [undefined, user, challenge, [pubKeyCredParam]],
        [rp, undefined, challenge, [pubKeyCredParam]],
        [rp, user, undefined, [pubKeyCredParam]],
        [rp, user, challenge, undefined],
        // missing rp attribute
        [{ name: undefined }, user, challenge, [pubKeyCredParam]],
        // missing user attribute
        [rp, { name: undefined, id: user.id, displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: undefined, displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: user.id, displayName: undefined}, challenge, [pubKeyCredParam]],
        // missing pubKeyCredParams attribute
        [rp, user, challenge, [{ type: undefined, alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: pubKeyCredParam.type, alg: undefined }]],
        // missing excludeCredentials attribute
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: undefined, id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: undefined }]]
    ];

    const wrongTypeAttributeVector = [
        // wrong rp attribute type
        [{ name: Symbol() }, user, challenge, [pubKeyCredParam]],
        [{ name: rp.name, icon: Symbol() }, user, challenge, [pubKeyCredParam]],
        [{ name: rp.name, id: Symbol() }, user, challenge, [pubKeyCredParam]],
        // wrong user attribute type
        [rp, { name: Symbol(), id: user.id, displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: 1, displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: true, displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: null, displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: Symbol(), displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: { }, displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: "foo", displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: [ ], displayName: user.displayName}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: user.id, displayName: Symbol()}, challenge, [pubKeyCredParam]],
        [rp, { name: user.name, id: user.id, displayName: user.displayName, icon: Symbol()}, challenge, [pubKeyCredParam]],
        // wrong challenge type
        [rp, user, 1, [pubKeyCredParam]],
        [rp, user, true, [pubKeyCredParam]],
        [rp, user, null, [pubKeyCredParam]],
        [rp, user, Symbol(), [pubKeyCredParam]],
        [rp, user, "foo", [pubKeyCredParam]],
        [rp, user, [ ], [pubKeyCredParam]],
        [rp, user, { }, [pubKeyCredParam]],
        // wrong pubKeyCredParam type
        [rp, user, challenge, [{ type: 1, alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: true, alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: null, alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: Symbol(), alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: "foo", alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: [ ], alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: { }, alg: pubKeyCredParam.alg }]],
        [rp, user, challenge, [{ type: pubKeyCredParam.type, alg: Symbol() }]],
        // wrong timeout type
        [rp, user, challenge, [pubKeyCredParam], Symbol(), undefined],
        // wrong excludeCredentials
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: 1, id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: true, id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: null, id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: Symbol(), id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: "foo", id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: [ ], id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: { }, id: excludeCredentials.id }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: 1 }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: true }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: null }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: Symbol() }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: "foo" }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: [ ] }]],
        [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: { } }]]
    ]

    function makeOptions(attributes)
    {
        if (attributes.length == 4)
            return { publicKey: { rp: attributes[0], user: attributes[1], challenge: attributes[2], pubKeyCredParams: attributes[3] } };
        return { publicKey: { rp: attributes[0], user: attributes[1], challenge: attributes[2], pubKeyCredParams: attributes[3], timeout: attributes[4],  excludeCredentials: attributes[5]} };
    }

    function runTest(attributesVectors) {
        attributesVectors.forEach(function(attributesVector) {
            attributesVector.forEach(async function(attributes) {
                invalidOptions = makeOptions(attributes);
                await shouldReject('navigator.credentials.create(invalidOptions)');
            });
        });

        finishJSTest();
    }

    const vectors = [];
    vectors.push(missingAttributeVector);
    vectors.push(wrongTypeAttributeVector);
    runTest(vectors);
</script>
</body>
</html>
