Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-payment-disabled.html

Issue 2767983003: Initial Implementation of Iframe Attribute for Feature Policy (Part 4) (Closed)
Patch Set: Nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <title>Feature-Policy PaymentRequest Disabled</title>
3 <title>Feature-Policy PaymentRequest Disabled</title> 3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 </head>
7 <script> 5 <script>
8 test(function() { 6 test(function() {
9 var supportedInstruments = [ { supportedMethods: [ 'visa' ] } ]; 7 var supportedInstruments = [ { supportedMethods: [ 'visa' ] } ];
10 var details = { 8 var details = {
11 total: { label: 'Test', amount: { currency: 'USD', value: '5.00' } } 9 total: { label: 'Test', amount: { currency: 'USD', value: '5.00' } }
12 }; 10 };
13 try { 11 try {
14 new PaymentRequest(supportedInstruments, details); 12 new PaymentRequest(supportedInstruments, details);
15 assert_unreached('PaymentRequest should be disabled by FeaturePolicy'); 13 assert_unreached('PaymentRequest should be disabled by FeaturePolicy');
16 } catch (e) { 14 } catch (e) {
17 if ( e.message.includes("assert_unreached") ) { throw e; } 15 if ( e.message.includes("assert_unreached") ) { throw e; }
18 assert_equals(e.name, "SecurityError"); 16 assert_equals(e.name, "SecurityError");
19 assert_equals(e.message, "Failed to construct 'PaymentRequest': Must be in a top-level browsing context or an iframe needs to specify 'allowpaymentrequest ' explicitly"); 17 assert_equals(e.message, "Failed to construct 'PaymentRequest': Must be in a top-level browsing context or an iframe needs to specify 'allowpaymentrequest ' explicitly");
20 } 18 }
21 }, 'No iframe may construct PaymentRequest when disabled.'); 19 }, 'No iframe may construct PaymentRequest when disabled.');
22 </script> 20 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698