File tree Expand file tree Collapse file tree 4 files changed +1
-32
lines changed Expand file tree Collapse file tree 4 files changed +1
-32
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,6 @@ export class Download {
39
39
this . _url = url ;
40
40
this . _finishedCallback = ( ) => { } ;
41
41
this . _finishedPromise = new Promise ( f => this . _finishedCallback = f ) ;
42
- for ( const barrier of this . _page . _frameManager . _signalBarriers )
43
- barrier . addDownload ( ) ;
44
42
this . _page . emit ( Events . Page . Download , this ) ;
45
43
page . _browserContext . _downloads . add ( this ) ;
46
44
this . _acceptDownloads = ! ! this . _page . _browserContext . _options . acceptDownloads ;
Original file line number Diff line number Diff line change @@ -147,10 +147,6 @@ export class FFPage implements PageDelegate {
147
147
148
148
_onNavigationAborted ( params : Protocol . Page . navigationAbortedPayload ) {
149
149
const frame = this . _page . _frameManager . frame ( params . frameId ) ! ;
150
- if ( params . errorText === 'Will download to file' ) {
151
- for ( const barrier of this . _page . _frameManager . _signalBarriers )
152
- barrier . expectDownload ( ) ;
153
- }
154
150
for ( const task of frame . _frameTasks )
155
151
task . onNewDocument ( params . navigationId , new Error ( params . errorText ) ) ;
156
152
}
Original file line number Diff line number Diff line change @@ -948,7 +948,6 @@ export class SignalBarrier {
948
948
private _options : types . NavigatingActionWaitOptions ;
949
949
private _protectCount = 0 ;
950
950
private _expectedPopups = 0 ;
951
- private _expectedDownloads = 0 ;
952
951
private _promise : Promise < void > ;
953
952
private _promiseCallback = ( ) => { } ;
954
953
private _deadline : number ;
@@ -989,16 +988,6 @@ export class SignalBarrier {
989
988
this . release ( ) ;
990
989
}
991
990
992
- async expectDownload ( ) {
993
- ++ this . _expectedDownloads ;
994
- }
995
-
996
- async addDownload ( ) {
997
- if ( this . _expectedDownloads )
998
- -- this . _expectedDownloads ;
999
- this . _maybeResolve ( ) ;
1000
- }
1001
-
1002
991
retain ( ) {
1003
992
++ this . _protectCount ;
1004
993
}
@@ -1009,7 +998,7 @@ export class SignalBarrier {
1009
998
}
1010
999
1011
1000
private async _maybeResolve ( ) {
1012
- if ( ! this . _protectCount && ! this . _expectedPopups && ! this . _expectedDownloads && ! this . _frameIds . size )
1001
+ if ( ! this . _protectCount && ! this . _expectedPopups && ! this . _frameIds . size )
1013
1002
this . _promiseCallback ( ) ;
1014
1003
}
1015
1004
}
Original file line number Diff line number Diff line change @@ -54,20 +54,6 @@ describe('Auto waiting', () => {
54
54
] ) ;
55
55
expect ( messages . join ( '|' ) ) . toBe ( 'popup|click' ) ;
56
56
} ) ;
57
- it . fail ( CHROMIUM ) ( 'should await download when clicking anchor' , async function ( { page, server} ) {
58
- server . setRoute ( '/download' , ( req , res ) => {
59
- res . setHeader ( 'Content-Type' , 'application/octet-stream' ) ;
60
- res . setHeader ( 'Content-Disposition' , 'attachment' ) ;
61
- res . end ( `Hello world` ) ;
62
- } ) ;
63
- await page . setContent ( `<a download=true href="${ server . PREFIX } /download">download</a>` ) ;
64
- const messages = [ ] ;
65
- await Promise . all ( [
66
- page . waitForEvent ( 'download' ) . then ( ( ) => messages . push ( 'download' ) ) ,
67
- page . click ( 'a' ) . then ( ( ) => messages . push ( 'click' ) ) ,
68
- ] ) ;
69
- expect ( messages . join ( '|' ) ) . toBe ( 'download|click' ) ;
70
- } ) ;
71
57
it ( 'should await cross-process navigation when clicking anchor' , async ( { page, server} ) => {
72
58
const messages = [ ] ;
73
59
server . setRoute ( '/empty.html' , async ( req , res ) => {
You can’t perform that action at this time.
0 commit comments