Bug 1489982 [wpt PR 12927] - test PaymentMethodChangeEventInit defaults, a=testonly
authorMarcos Cáceres <marcos@marcosc.com>
Thu, 13 Sep 2018 02:52:13 +0000
changeset 492158 d91e5930746ebee939dec7da28246f738206451b
parent 492157 075ae925437941495e90ce5d3ebb52376219fb6e
child 492159 24ad0a7f3357ac5663651a244658c034d88b57b1
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1489982, 12927
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1489982 [wpt PR 12927] - test PaymentMethodChangeEventInit defaults, a=testonly Automatic update from web-platform-teststest PaymentMethodChangeEventInit defaults (#12927) -- wpt-commits: fb29e1f2bb4ba390879b31ac49ce14d971fadf69 wpt-pr: 12927
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https.html
testing/web-platform/tests/payment-request/PaymentMethodChangeEvent/methodName-attribute.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -626549,21 +626549,21 @@
    "65d56e7490111f6fc9e91f4470379fc89ae42972",
    "manual"
   ],
   "payment-request/PaymentItem/type_member.https.html": [
    "dc62a83f597a0b53c686689fb8f549130982242a",
    "testharness"
   ],
   "payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https.html": [
-   "a478c559d497e8dea9d471ce1e36427bfb741aa7",
+   "ec0aa96dddb46b26617064ab54e9d02e2a588cbb",
    "testharness"
   ],
   "payment-request/PaymentMethodChangeEvent/methodName-attribute.https.html": [
-   "e6e0bf9a91971b3a20acf59cf27097281f0d2085",
+   "176638c7852f6f0f8fd7a8c3dfefdf439a829d22",
    "testharness"
   ],
   "payment-request/PaymentRequestUpdateEvent/constructor.http.html": [
    "db7765f7bf98c38935804c2588614911a97a2290",
    "testharness"
   ],
   "payment-request/PaymentRequestUpdateEvent/constructor.https.html": [
    "fd66493bf4f2aa006e99198094d1b7afd34f4543",
--- a/testing/web-platform/tests/payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https.html
+++ b/testing/web-platform/tests/payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https.html
@@ -14,9 +14,20 @@ test(() => {
     methodName: "wpt-test",
     methodDetails
   });
   assert_idl_attribute(event, "methodDetails");
   const { test } = event.methodDetails;
   assert_equals(test, "pass");
   assert_equals(event.methodDetails, methodDetails);
 }, "Must have a methodDetails IDL attribute, which is initialized with to the methodName dictionary value");
+
+test(() => {
+  const event = new PaymentMethodChangeEvent("test");
+  assert_equals(event.methodDetails, null, "methodDetails attribute must initialize to null");
+
+  const event2 = new PaymentMethodChangeEvent("test", { methodName: "basic-card" });
+  assert_equals(event2.methodDetails, null, "methodDetails attribute must initialize to null");
+
+  const event3 = new PaymentMethodChangeEvent("test", {});
+  assert_equals(event2.methodDetails, null, "methodDetails attribute must initialize to null");
+}, "The methodDetails member defaults to null");
 </script>
--- a/testing/web-platform/tests/payment-request/PaymentMethodChangeEvent/methodName-attribute.https.html
+++ b/testing/web-platform/tests/payment-request/PaymentMethodChangeEvent/methodName-attribute.https.html
@@ -9,9 +9,20 @@
 test(() => {
   const event = new PaymentMethodChangeEvent("test", {
     methodName: "wpt-test",
   });
   assert_idl_attribute(event, "methodName");
   const { methodName } = event;
   assert_equals(methodName, "wpt-test");
 }, "Must have a methodName IDL attribute, which is initialized with to the methodName dictionary value");
+
+test(() => {
+  const event = new PaymentMethodChangeEvent("test");
+  assert_equals(event.methodName, "", "methodName attribute must initialize to empty string");
+
+  const event2 = new PaymentMethodChangeEvent("test", { methodDetails: {} });
+  assert_equals(event2.methodName, "", "methodName attribute must initialize to empty string");
+
+  const event3 = new PaymentMethodChangeEvent("test", {});
+  assert_equals(event3.methodName, "", "methodName attribute must initialize to empty string");
+}, "When no dictionary is passed, the methodName member defaults to the empty string");
 </script>