mirror of
https://github.com/servo/servo.git
synced 2025-07-15 11:23:39 +01:00
46 lines
No EOL
2.9 KiB
HTML
46 lines
No EOL
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>WebAuthn navigator.credentials.create() rp Tests</title>
|
|
<meta name="timeout" content="long">
|
|
<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";
|
|
|
|
// rp bad values
|
|
new CreateCredentialsTest({path: "options.publicKey.rp", value: undefined}).runTest("Bad rp: rp missing", new TypeError());
|
|
new CreateCredentialsTest({ path: "options.publicKey.rp", value: null }).runTest("Bad rp: rp null", "NotSupportedError");
|
|
new CreateCredentialsTest("options.publicKey.rp", "hi mom").runTest("Bad rp: rp is string", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp", {}).runTest("Bad rp: rp is empty object", new TypeError());
|
|
|
|
// // rp.id
|
|
new CreateCredentialsTest("options.publicKey.rp.id", {}).runTest("Bad rp: id is object", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp.id", null).runTest("Bad rp: id is null", "SecurityError");
|
|
new CreateCredentialsTest("options.publicKey.rp.id", "").runTest("Bad rp: id is empty String", "SecurityError");
|
|
new CreateCredentialsTest("options.publicKey.rp.id", "invalid domain.com").runTest("Bad rp: id is invalid domain (has space)", "SecurityError");
|
|
new CreateCredentialsTest("options.publicKey.rp.id", "-invaliddomain.com").runTest("Bad rp: id is invalid domain (starts with dash)", "SecurityError");
|
|
new CreateCredentialsTest("options.publicKey.rp.id", "0invaliddomain.com").runTest("Bad rp: id is invalid domain (starts with number)", "SecurityError");
|
|
|
|
// // rp.name
|
|
new CreateCredentialsTest({path: "options.publicKey.rp.name", value: undefined}).runTest("rp missing name", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp.name", {}).runTest("Bad rp: name is object", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp.name", null).runTest("Bad rp: name is null", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp.name", "").runTest("Bad rp: name is empty String", new TypeError());
|
|
|
|
// // rp.icon
|
|
new CreateCredentialsTest("options.publicKey.rp.icon", {}).runTest("Bad rp: icon is object", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp.icon", null).runTest("Bad rp: icon is null", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp.icon", "").runTest("Bad rp: icon is empty String", new TypeError());
|
|
new CreateCredentialsTest("options.publicKey.rp.icon", "http://fidoalliance.co.nz/testimages/catimage.png")
|
|
.runTest("Bad rp: icon is insecure", "SecurityError");
|
|
// // TODO: unicode tests for icon URL (see also: USVString)
|
|
});
|
|
|
|
/* JSHINT */
|
|
/* globals standardSetup, CreateCredentialsTest */
|
|
</script> |