Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Payment Request][WPT] Fix inactive page tests. #15332

Merged
merged 1 commit into from Feb 13, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Feb 11, 2019

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants