Skip to content

Commit

Permalink
payment-request: Fix active document test
Browse files Browse the repository at this point in the history
Use DOMException constructor from the proper realm. This is a regression
after b7f2dd3.
  • Loading branch information
TimothyGu committed Mar 2, 2020
1 parent a5a4207 commit 251ec02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions payment-request/rejects_if_not_active-manual.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
iframe,
"/payment-request/resources/page1.html"
);
// Save the DOMException of page1.html before navigating away.
const frameDOMException1 = iframe.contentWindow.DOMException;
// We navigate the iframe again, putting request1's document into an inactive state.
const request2 = await getLoadedPaymentRequest(
iframe,
Expand All @@ -71,6 +73,7 @@
await promise_rejects_dom(
t,
"AbortError",
frameDOMException1,
request1.show(),
"Inactive document, so must throw AbortError"
);
Expand All @@ -80,6 +83,7 @@
await promise_rejects_dom(
t,
"InvalidStateError",
iframe.contentWindow.DOMException,
request2.show(),
"Abort already called, so InvalidStateError"
);
Expand Down Expand Up @@ -112,6 +116,8 @@
innerIframe,
"/payment-request/resources/page2.html"
);
// Save DOMException from innerIframe before navigating away.
const innerIframeDOMException = innerIframe.contentWindow.DOMException;

// Navigate the outer iframe to a new location.
// Wait for the load event to fire.
Expand All @@ -128,6 +134,7 @@
await promise_rejects_dom(
t,
"AbortError",
innerIframeDOMException,
showPromise,
"Active, but not fully active, so must throw AbortError"
);
Expand Down

0 comments on commit 251ec02

Please sign in to comment.