Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore(bidi): cancel navigation that turned into a download (#37649)
Holger Benl549fa16e7cb0
diff --git a/packages/playwright-core/src/server/bidi/bidiPage.ts b/packages/playwright-core/src/server/bidi/bidiPage.tsindex f6d4976ec5..56d4d7c705 100644--- a/packages/playwright-core/src/server/bidi/bidiPage.ts+++ b/packages/playwright-core/src/server/bidi/bidiPage.ts@@ -238,6 +238,8 @@ export class BidiPage implements PageDelegate {if (!event.navigation)return;+ this._page.frameManager.frameAbortedNavigation(event.context, 'Download is starting');+let originPage = this._page.initializedOrUndefined();// If it's a new window download, report it on the opener page.if (!originPage && this._opener)diff --git a/tests/bidi/expectations/moz-firefox-nightly-library.txt b/tests/bidi/expectations/moz-firefox-nightly-library.txtindex fd6aafdb55..f7a77cf6ad 100644--- a/tests/bidi/expectations/moz-firefox-nightly-library.txt+++ b/tests/bidi/expectations/moz-firefox-nightly-library.txt@@ -9,12 +9,8 @@ library/browsercontext-har.spec.ts › should reload redirected navigation [timelibrary/browsercontext-network-event.spec.ts › should reject response.finished if context closes [timeout]library/browsercontext-page-event.spec.ts › should have about:blank for empty url with domcontentloaded [timeout]library/browsertype-connect.spec.ts › launchServer › should be able to connect 20 times to a single server without warnings [timeout]-library/browsertype-connect.spec.ts › launchServer › should error when saving download after deletion [timeout]-library/browsertype-connect.spec.ts › launchServer › should save download [timeout]library/browsertype-connect.spec.ts › launchServer › should saveAs videos from remote browser [timeout]library/browsertype-connect.spec.ts › run-server › should saveAs videos from remote browser [timeout]-library/browsertype-connect.spec.ts › run-server › should save download [timeout]-library/browsertype-connect.spec.ts › run-server › should error when saving download after deletion [timeout]library/capabilities.spec.ts › should not crash when clicking a label with a <input type="file"/> [timeout]library/channels.spec.ts › should work with the domain module [timeout]library/chromium/chromium.spec.ts › PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS=1 › serviceWorker(), and fromServiceWorker() work [timeout]@@ -40,51 +36,8 @@ library/chromium/launcher.spec.ts › should report console messages from contenlibrary/chromium/launcher.spec.ts › should return background pages [timeout]library/chromium/launcher.spec.ts › should return background pages when recording video [timeout]library/chromium/launcher.spec.ts › should support request/response events when using backgroundPage() [timeout]-library/defaultbrowsercontext-1.spec.ts › should support acceptDownloads option [timeout]library/defaultbrowsercontext-2.spec.ts › should handle exception [timeout]library/defaultbrowsercontext-2.spec.ts › should support geolocation and permissions options [timeout]-library/download.spec.ts › download event › should emit download event from nested iframes [timeout]-library/download.spec.ts › download event › should report downloads with acceptDownloads: false [timeout]-library/download.spec.ts › download event › should report downloads with acceptDownloads: true [timeout]-library/download.spec.ts › download event › should report proper download url when download is from download attribute [timeout]-library/download.spec.ts › download event › should report downloads for download attribute [timeout]-library/download.spec.ts › download event › should save to user-specified path without updating original path [timeout]-library/download.spec.ts › download event › should save to two different paths with multiple saveAs calls [timeout]-library/download.spec.ts › download event › should save to overwritten filepath [timeout]-library/download.spec.ts › download event › should create subdirectories when saving to non-existent user-specified path [timeout]-library/download.spec.ts › download event › should error when saving with downloads disabled [timeout]-library/download.spec.ts › download event › should error when saving after deletion [timeout]-library/download.spec.ts › download event › should report non-navigation downloads [timeout]-library/download.spec.ts › download event › should report download path within page.on('download', …) handler for Files [timeout]-library/download.spec.ts › download event › should report download path within page.on('download', …) handler for Blobs [timeout]-library/download.spec.ts › download event › should report alt-click downloads [timeout]-library/download.spec.ts › download event › should report new window downloads [timeout]-library/download.spec.ts › download event › should delete file [timeout]-library/download.spec.ts › download event › should expose stream [timeout]-library/download.spec.ts › download event › should delete downloads on context destruction [timeout]-library/download.spec.ts › download event › should delete downloads on browser gone [timeout]-library/download.spec.ts › download event › should close the context without awaiting the download [timeout]-library/download.spec.ts › download event › should throw if browser dies [timeout]-library/download.spec.ts › download event › should download large binary.zip [timeout]-library/download.spec.ts › download event › should be able to cancel pending downloads [timeout]-library/download.spec.ts › download event › should not fail explicitly to cancel a download even if that is already finished [timeout]-library/download.spec.ts › download event › should report downloads with interception [timeout]-library/download.spec.ts › download event › should report download when navigation turns into download @smoke [timeout]-library/download.spec.ts › download event › should work with Cross-Origin-Opener-Policy [timeout]-library/download.spec.ts › should be able to download a PDF file [timeout]-library/download.spec.ts › should be able to download a inline PDF file via response interception [timeout]-library/download.spec.ts › should be able to download a inline PDF file via navigation [timeout]-library/download.spec.ts › should save to user-specified path [timeout]-library/download.spec.ts › should download even if there is no "attachment" value [timeout]-library/download.spec.ts › should download links with data url [timeout]-library/download.spec.ts › should download successfully when routing [timeout]-library/downloads-path.spec.ts › downloads path › should keep downloadsPath folder [timeout]-library/downloads-path.spec.ts › downloads path › should delete downloads when context closes [timeout]-library/downloads-path.spec.ts › downloads path › should report downloads in downloadsPath folder [timeout]-library/downloads-path.spec.ts › downloads path › should report downloads in downloadsPath folder with a relative path [timeout]-library/downloads-path.spec.ts › downloads path › should accept downloads in persistent context [timeout]-library/downloads-path.spec.ts › downloads path › should delete downloads when persistent context closes [timeout]-library/download.spec.ts › should convert navigation to a resource with unsupported mime type into download [timeout]library/fetch-proxy.spec.ts › context request should pick up proxy credentials [timeout]library/geolocation.spec.ts › should isolate contexts [timeout]library/geolocation.spec.ts › should use context options [timeout]