tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

payment-disabled-by-feature-policy.https.sub.html (1200B)


      1 <!DOCTYPE html>
      2 <body>
      3  <script src=/resources/testharness.js></script>
      4  <script src=/resources/testharnessreport.js></script>
      5  <script src=/feature-policy/resources/featurepolicy.js></script>
      6  <script>
      7  'use strict';
      8  var same_origin_src = '/feature-policy/resources/feature-policy-payment.html';
      9  var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
     10    same_origin_src;
     11  var header = 'Feature-Policy header {"payment" : []}';
     12 
     13  test(() => {
     14    var supportedInstruments = [ { supportedMethods: 'visa' } ];
     15    var details = {
     16      total: { label: 'Test', amount: { currency: 'USD', value: '5.00' } }
     17    };
     18    assert_throws_dom('SecurityError', () => {
     19      new PaymentRequest(supportedInstruments, details);
     20    });
     21  }, header + ' disallows the top-level document.');
     22 
     23  async_test(t => {
     24    test_feature_availability('PaymentRequest()', t, same_origin_src,
     25        expect_feature_unavailable_default);
     26  }, header + ' disallows same-origin iframes.');
     27 
     28  async_test(t => {
     29    test_feature_availability('PaymentRequest()', t, cross_origin_src,
     30        expect_feature_unavailable_default,);
     31  }, header + ' disallows cross-origin iframes.');
     32 
     33  </script>
     34 </body>