@@ -19,6 +19,7 @@ import fs from 'fs';
19
19
import path from 'path' ;
20
20
import util from 'util' ;
21
21
import crypto from 'crypto' ;
22
+ import { chromiumVersionLessThan } from './config/utils' ;
22
23
23
24
it . describe ( 'download event' , ( ) => {
24
25
it . beforeEach ( async ( { server} ) => {
@@ -361,7 +362,7 @@ it.describe('download event', () => {
361
362
expect ( fs . existsSync ( path . join ( path1 , '..' ) ) ) . toBeFalsy ( ) ;
362
363
} ) ;
363
364
364
- it ( 'should close the context without awaiting the failed download' , async ( { browser, server, httpsServer, browserName} , testInfo ) => {
365
+ it ( 'should close the context without awaiting the failed download' , async ( { browser, server, httpsServer, browserName, browserVersion } , testInfo ) => {
365
366
it . skip ( browserName !== 'chromium' , 'Only Chromium downloads on alt-click' ) ;
366
367
367
368
const page = await browser . newPage ( { acceptDownloads : true } ) ;
@@ -379,7 +380,10 @@ it.describe('download event', () => {
379
380
page . context ( ) . close ( ) ,
380
381
] ) ;
381
382
expect ( downloadPath ) . toBe ( null ) ;
382
- expect ( saveError . message ) . toContain ( 'File deleted upon browser context closure.' ) ;
383
+ if ( chromiumVersionLessThan ( browserVersion , '91.0.4472.0' ) )
384
+ expect ( saveError . message ) . toContain ( 'File deleted upon browser context closure.' ) ;
385
+ else
386
+ expect ( saveError . message ) . toContain ( 'File not found on disk. Check download.failure() for details.' ) ;
383
387
} ) ;
384
388
385
389
it ( 'should close the context without awaiting the download' , async ( { browser, server, browserName, platform} , testInfo ) => {
0 commit comments