mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Update web-platform-tests to revision abd18b3e018d25ed668d179c905b7869dca5e239
This commit is contained in:
parent
908a642063
commit
158f7eec0e
117 changed files with 2997 additions and 434 deletions
|
@ -0,0 +1,59 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
// META: script=helpers.js
|
||||
|
||||
// https://w3c.github.io/webauthn/
|
||||
|
||||
'use strict';
|
||||
|
||||
promise_test(() => {
|
||||
const execute_test = () => idl_test(
|
||||
['webauthn'],
|
||||
['credential-management'],
|
||||
idlArray => {
|
||||
idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface ArrayBuffer {};");
|
||||
idlArray.add_objects({
|
||||
WebAuthentication: ['navigator.authentication'],
|
||||
PublicKeyCredential: ['cred'],
|
||||
AuthenticatorAssertionResponse: ['assertionResponse']
|
||||
});
|
||||
},
|
||||
'WebAuthn interfaces.'
|
||||
);
|
||||
|
||||
let challengeBytes = new Uint8Array(16);
|
||||
window.crypto.getRandomValues(challengeBytes);
|
||||
|
||||
return createCredential({
|
||||
options: {
|
||||
publicKey: {
|
||||
timeout: 3000,
|
||||
user: {
|
||||
id: new Uint8Array(16),
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(cred => {
|
||||
self.cred = cred;
|
||||
return navigator.credentials.get({
|
||||
publicKey: {
|
||||
timeout: 3000,
|
||||
allowCredentials: [{
|
||||
id: cred.rawId,
|
||||
transports: ["usb", "nfc", "ble"],
|
||||
type: "public-key"
|
||||
}],
|
||||
challenge: challengeBytes,
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(assertion => {
|
||||
self.assertionResponse = assertion.response;
|
||||
})
|
||||
.then(execute_test)
|
||||
.catch(reason => {
|
||||
execute_test();
|
||||
return Promise.reject(reason);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue