Update web-platform-tests to revision d73b07b850fa51f23e846518bb6e8c59c58eef19

This commit is contained in:
WPT Sync Bot 2019-04-29 21:53:13 -04:00
parent 62031e3cb0
commit 7776ed79d7
107 changed files with 3306 additions and 538 deletions

View file

@ -0,0 +1,30 @@
self.addEventListener('canmakepayment', (event) => {
event.respondWith(true);
});
async function responder(event) {
const methodName = event.methodData[0].supportedMethods;
if (!event.changePaymentMethod) {
return {
methodName,
details: {
changePaymentMethodReturned:
'The changePaymentMethod() method is not implemented.',
},
};
}
let changePaymentMethodReturned;
try {
const response = await event.changePaymentMethod(methodName, {
country: 'US',
});
changePaymentMethodReturned = response;
} catch (err) {
changePaymentMethodReturned = error.message;
}
return {methodName, details: {changePaymentMethodReturned}};
}
self.addEventListener('paymentrequest', (event) => {
event.respondWith(responder(event));
});