@@ -129,11 +129,14 @@ it('should work with glob', async () => {
129129 expect ( urlMatches ( 'http://first.host/' , 'http://second.host/foo' , '**/foo' ) ) . toBeTruthy ( ) ;
130130 expect ( urlMatches ( 'http://playwright.dev/' , 'http://localhost/' , '*//localhost/' ) ) . toBeTruthy ( ) ;
131131
132- expect ( urlMatches ( 'http://playwright.dev/' , 'about:blank' , 'about:blank' ) ) . toBeTruthy ( ) ;
133- expect ( urlMatches ( 'http://playwright.dev/' , 'about:blank' , 'http://playwright.dev/' ) ) . toBeFalsy ( ) ;
134- expect ( urlMatches ( undefined , 'about:blank' , 'about:blank' ) ) . toBeTruthy ( ) ;
135- expect ( urlMatches ( undefined , 'about:blank' , 'about:*' ) ) . toBeTruthy ( ) ;
136- expect ( urlMatches ( undefined , 'notabout:blank' , 'about:*' ) ) . toBeFalsy ( ) ;
132+ const customPrefixes = [ 'about' , 'data' , 'chrome' , 'edge' , 'file' ] ;
133+ for ( const prefix of customPrefixes ) {
134+ expect ( urlMatches ( 'http://playwright.dev/' , `${ prefix } :blank` , `${ prefix } :blank` ) ) . toBeTruthy ( ) ;
135+ expect ( urlMatches ( 'http://playwright.dev/' , `${ prefix } :blank` , `http://playwright.dev/` ) ) . toBeFalsy ( ) ;
136+ expect ( urlMatches ( undefined , `${ prefix } :blank` , `${ prefix } :blank` ) ) . toBeTruthy ( ) ;
137+ expect ( urlMatches ( undefined , `${ prefix } :blank` , `${ prefix } :*` ) ) . toBeTruthy ( ) ;
138+ expect ( urlMatches ( undefined , `not${ prefix } :blank` , `${ prefix } :*` ) ) . toBeFalsy ( ) ;
139+ }
137140} ) ;
138141
139142it ( 'should intercept by glob' , async function ( { page, server, isAndroid } ) {
0 commit comments