Update web-platform-tests to revision d04a8fc02b85bd32799691759c8c05ead07cd939

This commit is contained in:
WPT Sync Bot 2018-03-23 21:12:55 -04:00
parent e8fdc677f4
commit 2b35c55ac7
63 changed files with 2068 additions and 340 deletions

View file

@ -9,6 +9,35 @@
setup({
explicit_done: true,
explicit_timeout: true,
allow_uncaught_exception: true,
});
const defaultMethods = Object.freeze([
{ supportedMethods: "basic-card" },
{ supportedMethods: "https://apple.com/pay" },
]);
const defaultDetails = Object.freeze({
id: "fail",
total: {
label: "Total",
amount: {
currency: "USD",
value: "1.00",
},
},
});
test(() => {
assert_throws(
"SecurityError",
() => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
request.show(); // <--- should throw here
request.abort();
},
"throws a SecurityError if not triggered by user activation"
);
});
async function runUserActivation(button) {
@ -27,6 +56,7 @@ async function runUserActivation(button) {
}, button.textContent.trim());
done();
}
</script>
<h2>Test PaymentRequest.show() triggered by user activation using postMessage()</h2>
<p>