blob: 68d3fbb1fb219231c4a1a8f66dbee3c9181c5c42 [file] [log] [blame]
<!DOCTYPE html>
<title>Credential Management API: get() basics.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(function(t) {
return promise_rejects(t, "NotSupportedError",
navigator.credentials.get());
}, "navigator.credentials.get() with no argument.");
promise_test(function(t) {
return promise_rejects(t, "NotSupportedError",
navigator.credentials.get({ }));
}, "navigator.credentials.get() with empty argument.");
promise_test(function(t) {
return promise_rejects(t, new TypeError(),
navigator.credentials.get({publicKey: "bogus publicKey data"}));
}, "navigator.credentials.get() with bogus publicKey data");
promise_test(function(t) {
return promise_rejects(t, "NotSupportedError",
navigator.credentials.get({bogus_key: "bogus data"}));
}, "navigator.credentials.get() with bogus data");
promise_test(function(t) {
var controller = new AbortController();
var options = { signal: controller.signal };
controller.abort();
return promise_rejects(t, "AbortError",
navigator.credentials.get(options));
}, "navigator.credentials.get() with abort signal set");
</script>