mirror of
https://github.com/servo/servo.git
synced 2025-07-12 09:53:40 +01:00
22 lines
802 B
HTML
22 lines
802 B
HTML
<!doctype html>
|
|
<title>PaymentRequest <iframe allowpaymentrequest> in non-active document (same-origin)</title>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<iframe id="iframe" allowpaymentrequest></iframe>
|
|
<script>
|
|
async_test((t) => {
|
|
const iframe = document.getElementById('iframe');
|
|
const paymentArgs = [[{supportedMethods: 'foo'}], {total: {label: 'label', amount: {currency: 'USD', value: '5.00'}}}];
|
|
|
|
onload = () => {
|
|
const win = window[0];
|
|
const grabbedPaymentRequest = win.PaymentRequest;
|
|
win.location.href = '/common/blank.html';
|
|
iframe.onload = t.step_func_done(() => {
|
|
assert_throws({name: 'SecurityError'}, () => {
|
|
new grabbedPaymentRequest(...paymentArgs);
|
|
});
|
|
});
|
|
}
|
|
});
|
|
</script>
|