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
browser(firefox): report navigation request failure for downloads (#1688)
Yury Semikhatskybecf97f30d78
diff --git a/browser_patches/firefox/BUILD_NUMBER b/browser_patches/firefox/BUILD_NUMBERindex bba0bc80a9..cf635ffb9e 100644--- a/browser_patches/firefox/BUILD_NUMBER+++ b/browser_patches/firefox/BUILD_NUMBER@@ -1 +1 @@-1073+1074diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diffindex 3444207a39..9ab19e3aef 100644--- a/browser_patches/firefox/patches/bootstrap.diff+++ b/browser_patches/firefox/patches/bootstrap.diff@@ -2953,10 +2953,10 @@ index 0000000000000000000000000000000000000000..268fbc361d8053182bb6c27f626e853d+diff --git a/juggler/content/FrameTree.js b/juggler/content/FrameTree.jsnew file mode 100644-index 0000000000000000000000000000000000000000..5a1df2837d70531a670163b7c860108895bc9106+index 0000000000000000000000000000000000000000..8a87dabd37e83cba0f1dfac07d8fd18875c042ef--- /dev/null+++ b/juggler/content/FrameTree.js-@@ -0,0 +1,462 @@+@@ -0,0 +1,471 @@+"use strict";+const Ci = Components.interfaces;+const Cr = Components.results;@@ -3149,12 +3149,19 @@ index 0000000000000000000000000000000000000000..5a1df2837d70531a670163b7c8601088+ const isTransferring = flag & Ci.nsIWebProgressListener.STATE_TRANSFERRING;+ const isStop = flag & Ci.nsIWebProgressListener.STATE_STOP;+++ let isDownload = false;++ try {++ isDownload = (channel.contentDisposition === Ci.nsIChannel.DISPOSITION_ATTACHMENT);++ } catch(e) {++ // The method is expected to throw if it's not an attachment.++ }+++ if (isStart) {+ // Starting a new navigation.+ frame._pendingNavigationId = this._channelId(channel);+ frame._pendingNavigationURL = channel.URI.spec;+ this.emit(FrameTree.Events.NavigationStarted, frame);-+ } else if (isTransferring || (isStop && frame._pendingNavigationId && !status)) {++ } else if (isTransferring || (isStop && frame._pendingNavigationId && !status && !isDownload)) {+ // Navigation is committed.+ for (const subframe of frame._children)+ this._detachFrame(subframe);@@ -3166,12 +3173,14 @@ index 0000000000000000000000000000000000000000..5a1df2837d70531a670163b7c8601088+ this.emit(FrameTree.Events.NavigationCommitted, frame);+ if (frame === this._mainFrame)+ this.forcePageReady();-+ } else if (isStop && frame._pendingNavigationId && status) {++ } else if (isStop && frame._pendingNavigationId && (status || isDownload)) {+ // Navigation is aborted.+ const navigationId = frame._pendingNavigationId;+ frame._pendingNavigationId = null;+ frame._pendingNavigationURL = null;-+ this.emit(FrameTree.Events.NavigationAborted, frame, navigationId, helper.getNetworkErrorStatusText(status));++ // Always report download navigation as failure to match other browsers.++ const errorText = isDownload ? 'Will download to file' : helper.getNetworkErrorStatusText(status);++ this.emit(FrameTree.Events.NavigationAborted, frame, navigationId, errorText);+ }+ }+