109 lines
3.1 KiB
HTML
109 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>WebAuthn navigator.credentials.create() abort Tests</title>
|
|
<meta name="timeout" content="long">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/testdriver.js"></script>
|
|
<script src="/resources/testdriver-vendor.js"></script>
|
|
<script src=helpers.js></script>
|
|
<body></body>
|
|
<script>
|
|
"use strict";
|
|
|
|
virtualAuthenticatorPromiseTest(async t => {
|
|
const abortController = new AbortController();
|
|
const signal = abortController.signal;
|
|
abortController.abort();
|
|
const promise = createCredential({
|
|
options: {
|
|
signal: signal,
|
|
}
|
|
});
|
|
return promise_rejects_dom(t, "AbortError", promise);
|
|
}, {
|
|
protocol: "ctap1/u2f",
|
|
transport: "usb",
|
|
isUserConsenting: false,
|
|
}, "navigator.credentials.create() after abort without reason");
|
|
|
|
virtualAuthenticatorPromiseTest(async t => {
|
|
const abortController = new AbortController();
|
|
const signal = abortController.signal;
|
|
const promise = createCredential({
|
|
options: {
|
|
signal: signal,
|
|
}
|
|
});
|
|
abortController.abort();
|
|
return promise_rejects_dom(t, "AbortError", promise);
|
|
}, {
|
|
protocol: "ctap1/u2f",
|
|
transport: "usb",
|
|
isUserConsenting: false,
|
|
}, "navigator.credentials.create() before abort without reason");
|
|
|
|
virtualAuthenticatorPromiseTest(async t => {
|
|
const abortController = new AbortController();
|
|
const signal = abortController.signal;
|
|
abortController.abort("CustomError");
|
|
const promise = createCredential({
|
|
options: {
|
|
signal: signal,
|
|
}
|
|
});
|
|
return promise_rejects_exactly(t, "CustomError", promise);
|
|
}, {
|
|
protocol: "ctap1/u2f",
|
|
transport: "usb",
|
|
isUserConsenting: false,
|
|
}, "navigator.credentials.create() after abort reason");
|
|
|
|
virtualAuthenticatorPromiseTest(async t => {
|
|
const abortController = new AbortController();
|
|
const signal = abortController.signal;
|
|
const promise = createCredential({
|
|
options: {
|
|
signal: signal,
|
|
}
|
|
});
|
|
abortController.abort("CustomError");
|
|
return promise_rejects_exactly(t, "CustomError", promise);
|
|
}, {
|
|
protocol: "ctap1/u2f",
|
|
transport: "usb",
|
|
isUserConsenting: false,
|
|
}, "navigator.credentials.create() before abort reason");
|
|
|
|
virtualAuthenticatorPromiseTest(async t => {
|
|
const abortController = new AbortController();
|
|
const signal = abortController.signal;
|
|
abortController.abort(new Error('error'));
|
|
const promise = createCredential({
|
|
options: {
|
|
signal: signal,
|
|
}
|
|
});
|
|
return promise_rejects_js(t, Error, promise);
|
|
}, {
|
|
protocol: "ctap1/u2f",
|
|
transport: "usb",
|
|
isUserConsenting: false,
|
|
}, "navigator.credentials.create() after abort reason with Error");
|
|
|
|
virtualAuthenticatorPromiseTest(async t => {
|
|
const abortController = new AbortController();
|
|
const signal = abortController.signal;
|
|
const promise = createCredential({
|
|
options: {
|
|
signal: signal,
|
|
}
|
|
});
|
|
abortController.abort(new Error('error'));
|
|
return promise_rejects_js(t, Error, promise);
|
|
}, {
|
|
protocol: "ctap1/u2f",
|
|
transport: "usb",
|
|
isUserConsenting: false,
|
|
}, "navigator.credentials.create() before abort reason with Error");
|
|
</script>
|