mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Update web-platform-tests to revision 0a28ecf697d96db228f8382db0e41f1c54314dad
This commit is contained in:
parent
1ff56aa84f
commit
52045cb370
106 changed files with 1208 additions and 778 deletions
|
@ -7,24 +7,22 @@
|
|||
|
||||
'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']
|
||||
});
|
||||
}
|
||||
);
|
||||
idl_test(
|
||||
['webauthn'],
|
||||
['credential-management'],
|
||||
async idlArray => {
|
||||
idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface ArrayBuffer {};");
|
||||
idlArray.add_objects({
|
||||
WebAuthentication: ['navigator.authentication'],
|
||||
PublicKeyCredential: ['cred', 'assertion'],
|
||||
AuthenticatorAttestationResponse: ['cred.response'],
|
||||
AuthenticatorAssertionResponse: ['assertion.response']
|
||||
});
|
||||
|
||||
let challengeBytes = new Uint8Array(16);
|
||||
window.crypto.getRandomValues(challengeBytes);
|
||||
const challengeBytes = new Uint8Array(16);
|
||||
window.crypto.getRandomValues(challengeBytes);
|
||||
|
||||
return createCredential({
|
||||
self.cred = await createCredential({
|
||||
options: {
|
||||
publicKey: {
|
||||
timeout: 3000,
|
||||
|
@ -33,27 +31,18 @@ promise_test(() => {
|
|||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
.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);
|
||||
});
|
||||
});
|
||||
|
||||
self.assertion = await navigator.credentials.get({
|
||||
publicKey: {
|
||||
timeout: 3000,
|
||||
allowCredentials: [{
|
||||
id: cred.rawId,
|
||||
transports: ["usb", "nfc", "ble"],
|
||||
type: "public-key"
|
||||
}],
|
||||
challenge: challengeBytes,
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue