mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision d04a8fc02b85bd32799691759c8c05ead07cd939
This commit is contained in:
parent
e8fdc677f4
commit
2b35c55ac7
63 changed files with 2068 additions and 340 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue