Update web-platform-tests to revision 0a28ecf697d96db228f8382db0e41f1c54314dad

This commit is contained in:
WPT Sync Bot 2019-04-02 21:51:07 -04:00
parent 1ff56aa84f
commit 52045cb370
106 changed files with 1208 additions and 778 deletions

View file

@ -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,
}
});
}
);