tor-browser

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

idlharness.https.window.js (975B)


      1 // META: script=/resources/WebIDLParser.js
      2 // META: script=/resources/idlharness.js
      3 
      4 'use strict';
      5 
      6 // https://w3c.github.io/payment-request/
      7 
      8 idl_test(
      9  ['payment-request'],
     10  ['dom', 'html'],
     11  idlArray => {
     12    try {
     13      const methods = [
     14        {supportedMethods: 'basic-card'},
     15        {supportedMethods: 'https://apple.com/apple-pay'},
     16      ];
     17      const amount = {currency: 'USD', value: '0'};
     18      const details = {total: {label: 'label', amount: amount} };
     19      window.paymentRequest = new PaymentRequest(methods, details);
     20    } catch (e) {
     21      // Surfaced below when paymentRequest is undefined.
     22    }
     23 
     24    idlArray.add_objects({
     25      PaymentRequest: ['paymentRequest'],
     26      PaymentMethodChangeEvent: ['new PaymentMethodChangeEvent("paymentmethodchange")'],
     27      PaymentRequestUpdateEvent: ['new PaymentRequestUpdateEvent("paymentrequestupdate")'],
     28      MerchantValidationEvent: ['new MerchantValidationEvent("merchantvalidation")'],
     29    });
     30  }
     31 );