Bug 1633344 - Adding a wpt for duplicate payment method. r=marcosc
authorEden Chuang <echuang@mozilla.com>
Thu, 21 May 2020 10:30:12 +0000
changeset 531419 575a5d2fa72ad9d06c0a25ec015ef248c0b857cf
parent 531418 38ed46ba7e0dba4520ad063be3b1d5305fb9bb25
child 531420 f8994fa4909eba9fd2034b17a332ef35387c6fae
push id37439
push userbtara@mozilla.com
push dateThu, 21 May 2020 21:49:34 +0000
treeherdermozilla-central@92c11f0bf14b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcosc
bugs1633344
milestone78.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 1633344 - Adding a wpt for duplicate payment method. r=marcosc Differential Revision: https://phabricator.services.mozilla.com/D75559
testing/web-platform/tests/payment-request/payment-request-constructor.https.sub.html
--- a/testing/web-platform/tests/payment-request/payment-request-constructor.https.sub.html
+++ b/testing/web-platform/tests/payment-request/payment-request-constructor.https.sub.html
@@ -108,16 +108,29 @@ test(() => {
 
 test(() => {
   smokeTest();
   assert_throws_js(TypeError, () => new PaymentRequest([], defaultDetails));
 }, "If the length of the methodData sequence is zero, then throw a TypeError");
 
 test(() => {
   smokeTest();
+  const duplicateMethods = [
+    {
+      supportedMethods: "https://{{domains[nonexistent]}}/payment-request",
+    },
+    {
+      supportedMethods: "https://{{domains[nonexistent]}}/payment-request",
+    },
+  ];
+  assert_throws_js(RangeError, () => new PaymentRequest(duplicateMethods, defaultDetails));
+}, "If payment method is duplicate, then throw a RangeError");
+
+test(() => {
+  smokeTest();
   const JSONSerializables = [[], { object: {} }];
   for (const data of JSONSerializables) {
     try {
       const methods = [
         {
           supportedMethods: "https://{{domains[nonexistent]}}/payment-request",
           data,
         },