tor-browser

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

payment-request-shippingAddress-attribute.https.html (1178B)


      1 <!DOCTYPE html>
      2 <!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
      3 <meta charset="utf-8">
      4 <title>Test for PaymentRequest shippingAddress attribute</title>
      5 <link rel="help" href="https://w3c.github.io/payment-request/#shippingaddress-attribute">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script>
      9 const validMethod = Object.freeze({ supportedMethods: "foo" });
     10 const validMethods = Object.freeze([validMethod]);
     11 const validAmount = Object.freeze({ currency: "USD", value: "5.00" });
     12 const validTotal = Object.freeze({
     13  label: "label",
     14  amount: validAmount,
     15 });
     16 const validDetails = Object.freeze({ total: validTotal });
     17 
     18 test(() => {
     19  const request = new PaymentRequest(validMethods, validDetails);
     20  assert_idl_attribute(request, "shippingAddress");
     21 }, "Must have a .shippingAddress IDL attribute.");
     22 
     23 test(() => {
     24  const request = new PaymentRequest(validMethods, validDetails);
     25  assert_equals(request.shippingAddress, null, "expected null");
     26 }, ".shippingAddress attribute must default to null.");
     27 
     28 </script>