Bug 1527222 [wpt PR 15332] - [Payment Request][WPT] Fix inactive page tests., a=testonly
commitdacd0d712bf705abe67c6eb8f8f128ad4021b929
authorRouslan Solomakhin <rouslan@chromium.org>
Tue, 5 Mar 2019 11:12:13 +0000 (5 11:12 +0000)
committerJames Graham <james@hoppipolla.co.uk>
Fri, 15 Mar 2019 18:07:24 +0000 (15 18:07 +0000)
tree833e0b505bb4c0c0b6e7c9a6b359c98a130ff199
parent53192f2b61087818e684179337957959c43a2bd4
Bug 1527222 [wpt PR 15332] - [Payment Request][WPT] Fix inactive page tests., a=testonly

Automatic update from web-platform-tests
[Payment Request][WPT] Fix inactive page tests.

Before this patch, the tests for calling PaymentRequest.show() in an
inactive document failed because the renderer checked for an IPC
connection to the browser and rejected the show() promise with an
InvalidStateError because of the lack of the IPC connection. This
happens because the IPC connection is terminated after the browser
payment sheet closes, which happens upon a page becoming inactive.
Instead, the renderer should check for an active document first and
reject with AbortError in an inactive document.

This patch makes PaymentRequest.show() check for an active document
first and reject with AbortError in an inactive document. The IPC
connection is checked second.

This patch also makes a couple of active document test cases manual for
ease of testing. The last test case is not moved and is still failing.
It is unlikely to ever pass in Chrome, because it navigates away the
context where a PaymentRequest.show() promise object was created. After
the navigation, the promise object cannot change state in Chrome.

After this patch, two manual test cases for active document are passing
in Chrome.

Bug: 929773
Change-Id: Idbe9dbd03a69c18a4d24ba34642e6c7046026c62
Reviewed-on: https://chromium-review.googlesource.com/c/1463664
Reviewed-by: Danyao Wang <danyao@chromium.org>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631791}

--

wpt-commits: e6645a41093b3516eaa5bab63cd0ba65b3778a4e
wpt-pr: 15332
testing/web-platform/tests/payment-request/rejects_if_not_active.https.html
testing/web-platform/tests/payment-request/rejects_if_not_active_manual.https.html [new file with mode: 0644]