-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore(bidi): add support for the browsingContext.download* events #37299
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
Conversation
This comment has been minimized.
This comment has been minimized.
CC @OrKoN and @sadym-chromium given that you might be interested in those details. Looks like you may miss to update the status property in case of a successful download. |
@hbenl, how many tests are these which are hanging? We probably should add them as timing out to the expectation file. |
I think playwright is not using the latest chromium-bidi? Could that be bumped? The latest code looks correct https://github.com/GoogleChromeLabs/chromium-bidi/blob/main/src/bidiMapper/modules/context/BrowsingContextImpl.ts#L835 so it might be indeed cancelled? |
All of the tests in |
I would suggest to get this done in a separate PR once this landed. Could you do this @OrKoN?
Perfect. Then BiDi-wise this PR looks good to me. Thanks! |
Bumping chromium-bidi here #37318 Actually I looked up existing tests and I think the headless shell would cancel all downloads by default (https://github.com/GoogleChromeLabs/chromium-bidi/blob/main/tests/browsing_context/test_download.py#L83) I think playwright might be using the headless shell for the headless mode? or is it running with |
d9d6e08
to
a1eea7b
Compare
I've rebased the PR but that didn't fix any tests in Chromium.
But in headed mode the failures that are not timeouts throw the error "Path is not available when connecting remotely. Use saveAs() to save a local copy." and I don't see a |
Test results for "tests 1"5 flaky46762 passed, 819 skipped Merge workflow run. |
Yes, by default we run with headless shell, unless users explicitly opt-in to the new headless, see https://playwright.dev/docs/browsers#chromium-new-headless-mode |
@@ -217,6 +219,26 @@ export class BidiPage implements PageDelegate { | |||
event.defaultValue)); | |||
} | |||
|
|||
private _onDownloadWillBegin(event: bidi.BrowsingContext.DownloadWillBeginParams) { | |||
if (!event.navigation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean the code only applies to the navigations converted into downloads or what is this check for?
Fixes #37217 and the following tests in
tests/library/download.spec.ts
in Chrome:Most of the download tests are still failing because Chrome sends the
browsingContext.downloadEnd
event withstatus: "canceled"
and so methods likedownload.path()
fail.In Firefox the tests fail mostly because the
browsingContext.downloadEnd
event isn't implemented yet and so methods likedownload.path()
hang.