| Index: third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-payment-disabled.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-payment-disabled.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-payment-disabled.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cfe76f1d7a165c46b5ec695e6d0e4fa2e2e41db3
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-payment-disabled.html
|
| @@ -0,0 +1,22 @@
|
| +<!DOCTYPE html>
|
| +<head>
|
| + <title>Feature-Policy PaymentRequest Disabled</title>
|
| + <script src="/resources/testharness.js"></script>
|
| + <script src="/resources/testharnessreport.js"></script>
|
| +</head>
|
| +<script>
|
| + test(function() {
|
| + var supportedInstruments = [ { supportedMethods: [ 'visa' ] } ];
|
| + var details = {
|
| + total: { label: 'Test', amount: { currency: 'USD', value: '5.00' } }
|
| + };
|
| + try {
|
| + new PaymentRequest(supportedInstruments, details);
|
| + assert_unreached('PaymentRequest should be disabled by FeaturePolicy');
|
| + } catch (e) {
|
| + if ( e.message.includes("assert_unreached") ) { throw e; }
|
| + assert_equals(e.name, "SecurityError");
|
| + assert_equals(e.message, "Failed to construct 'PaymentRequest': Must be in a top-level browsing context or an iframe needs to specify 'allowpaymentrequest' explicitly");
|
| + }
|
| + }, 'No iframe may construct PaymentRequest when disabled.');
|
| +</script>
|
|
|