<!DOCTYPE html><!-- webkit-test-runner [ WebAuthenticationModernEnabled=true ] -->
<title>Web Authentication API: CTAP HID failure cases with a mock hid authenticator.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./resources/util.js"></script>
<script>
    const defaultOptions = {
        publicKey: {
            rp: {
                name: "example.com"
            },
            user: {
                name: "John Appleseed",
                id: asciiToUint8Array("123456"),
                displayName: "John",
            },
            challenge: asciiToUint8Array("123456"),
            pubKeyCredParams: [{ type: "public-key", alg: -7 }],
            timeout: 10
        }
    };

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "info", subStage: "init", error: "data-not-sent" } });
        return promiseRejects(t, "NotAllowedError", navigator.credentials.create(defaultOptions), "Operation timed out.");
    }, "CTAP HID with init sub stage data not sent error in a mock hid authenticator.");

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "info", subStage: "init", error: "empty-report" } });
        return promiseRejects(t, "NotAllowedError", navigator.credentials.create(defaultOptions), "Operation timed out.");
    }, "CTAP HID with init sub stage empty report error in a mock hid authenticator.");

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "info", subStage: "init", error: "wrong-channel-id" } });
        return promiseRejects(t, "NotAllowedError", navigator.credentials.create(defaultOptions), "Operation timed out.");
    }, "CTAP HID with init sub stage wrong channel id error in a mock hid authenticator.");

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "info", subStage: "init", error: "wrong-nonce" } });
        return promiseRejects(t, "NotAllowedError", navigator.credentials.create(defaultOptions), "Operation timed out.");
    }, "CTAP HID with init sub stage wrong nonce error in a mock hid authenticator.");

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "info", subStage: "msg", error: "data-not-sent" } });
        return promiseRejects(t, "NotAllowedError", navigator.credentials.create(defaultOptions), "Operation timed out.");
    }, "CTAP HID with msg sub stage data not sent error in a mock hid authenticator.");

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "info", subStage: "msg", error: "empty-report" } });
        return promiseRejects(t, "NotAllowedError", navigator.credentials.create(defaultOptions), "Operation timed out.");
    }, "CTAP HID with msg sub stage empty report error in a mock hid authenticator.");

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "info", subStage: "msg", error: "wrong-channel-id" } });
        return promiseRejects(t, "NotAllowedError", navigator.credentials.create(defaultOptions), "Operation timed out.");
    }, "CTAP HID with msg sub stage wrong channel id error in a mock hid authenticator.");

    promise_test(function(t) {
        if (window.internals)
            internals.setMockWebAuthenticationConfiguration({ hid: { stage: "request", subStage: "msg", error: "wrong-channel-id", payloadBase64:[testDummyMessagePayloadBase64] } });
        return promiseRejects(t, "UnknownError", navigator.credentials.create(defaultOptions), "Unknown internal error. Error code: 18");
    }, "CTAP HID with request::msg stage wrong channel id error in a mock hid authenticator.");
</script>
