Bug 1471088 [wpt PR 11665] - immediate repeated calls to .complete(), a=testonly
authorMarcos Cáceres <marcos@marcosc.com>
Fri, 06 Jul 2018 22:51:48 +0000
changeset 426067 230b33e1a7b58e94af967fe84add4259755e13b4
parent 426066 fb51d3d9a57367c2794817cdcf9a83994de1d49f
child 426068 15dd31210c81b01127d3abb66ca296fe67a65b94
push id34267
push userrgurzau@mozilla.com
push dateWed, 11 Jul 2018 22:05:21 +0000
treeherdermozilla-central@3aca103e4915 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1471088, 11665
milestone63.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 1471088 [wpt PR 11665] - immediate repeated calls to .complete(), a=testonly Automatic update from web-platform-testsimmediate repeated calls to .complete() (#11665) -- wpt-commits: e50750ae78cd80a01d6968337318612ee7451cf2 wpt-pr: 11665
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/payment-request/payment-response/complete-method-manual.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -603853,17 +603853,17 @@
    "d815dbb240dd8b4e03bd798c72d83f4c57b2cf12",
    "manual"
   ],
   "payment-request/payment-request-show-method.https.html": [
    "d11b121987240d9d2cb4a5f3f6814f83d45f52e6",
    "testharness"
   ],
   "payment-request/payment-response/complete-method-manual.https.html": [
-   "3a3e57155d5267e515f7d1711e99fb6a7d170eb7",
+   "366751b4fed2b18c08ce4daa7f77e4d557af5039",
    "manual"
   ],
   "payment-request/payment-response/helpers.js": [
    "992e5ce9af876e7d3f76168f15691afd43b41791",
    "support"
   ],
   "payment-request/payment-response/methodName-attribute-manual.https.html": [
    "316eaf783a676265d8833fe9935bf8a7597b8ddb",
--- a/testing/web-platform/tests/payment-request/payment-response/complete-method-manual.https.html
+++ b/testing/web-platform/tests/payment-request/payment-response/complete-method-manual.https.html
@@ -11,34 +11,28 @@
 async function runManualTest({ completeWith: result }, button) {
   button.disabled = true;
   const { response, request } = await getPaymentRequestResponse();
   promise_test(async () => {
     try {
       // We .complete() as normal, using the passed test value
       const promise = response.complete(result);
       assert_true(promise instanceof Promise, "returns a promise");
+      // Immediately calling complete() again yields a rejected promise.
+      await promise_rejects(t, "InvalidStateError", response.complete(result));
+      // but the original promise is unaffected
       const returnedValue = await promise;
       assert_equals(
         returnedValue,
         undefined,
         "Returned value must always be undefined"
       );
       // We now call .complete() again, to force an exception
-      // because [[completeCalled]] is true.
-      try {
-        await response.complete(result);
-        assert_unreached("Expected InvalidStateError to be thrown");
-      } catch (err) {
-        assert_equals(
-          err.code,
-          DOMException.INVALID_STATE_ERR,
-          "Must throw an InvalidStateError"
-        );
-      }
+      // because [[complete]] is true.
+      await promise_rejects(t, "InvalidStateError", response.complete(result));
       button.innerHTML = `✅  ${button.textContent}`;
     } catch (err) {
       button.innerHTML = `❌  ${button.textContent}`;
       assert_unreached("Unexpected exception: " + err.message);
     }
   }, button.textContent.trim());
 }
 </script>