@@ -29,7 +29,7 @@ const { CreateContextParameters } = require('selenium-webdriver/bidi/createConte
2929suite (
3030 function ( env ) {
3131 describe ( 'BiDi Permissions' , function ( ) {
32- let driver , permission , browser , script , browserName
32+ let driver , permission , browser , script
3333
3434 const GET_GEOLOCATION_PERMISSION =
3535 "async () => { const perm = await navigator.permissions.query({ name: 'geolocation' }); return perm.state; }"
4040 permission = await getPermissionInstance ( driver )
4141 browser = await BrowserBiDi ( driver )
4242 script = await getScriptManager ( [ ] , driver )
43- browserName = ( await driver . getCapabilities ( ) ) . getBrowserName ( ) . toLowerCase ( )
4443 } )
4544
4645 afterEach ( function ( ) {
@@ -51,17 +50,6 @@ suite(
5150 const context = await BrowsingContext ( driver , { type : 'tab' } )
5251 await context . navigate ( Pages . blankPage , 'complete' )
5352
54- const initialPermission = await script . callFunctionInBrowsingContext (
55- context . id ,
56- GET_GEOLOCATION_PERMISSION ,
57- true ,
58- [ ] ,
59- )
60-
61- // Chrome's default permission state is 'denied', while Firefox uses 'prompt'
62- const expectedDefaultState = [ 'chrome' , 'microsoftedge' ] . includes ( browserName ) ? 'denied' : 'prompt'
63- assert . strictEqual ( initialPermission . result . value , expectedDefaultState )
64-
6553 const origin = await script . callFunctionInBrowsingContext ( context . id , GET_ORIGIN , true , [ ] )
6654 const originValue = origin . result . value
6755
@@ -75,16 +63,6 @@ suite(
7563 const context = await BrowsingContext ( driver , { type : 'tab' } )
7664 await context . navigate ( Pages . blankPage , 'complete' )
7765
78- const initialPermission = await script . callFunctionInBrowsingContext (
79- context . id ,
80- GET_GEOLOCATION_PERMISSION ,
81- true ,
82- [ ] ,
83- )
84- // Chrome's default permission state is 'denied', while Firefox uses 'prompt'
85- const expectedDefaultState = [ 'chrome' , 'microsoftedge' ] . includes ( browserName ) ? 'denied' : 'prompt'
86- assert . strictEqual ( initialPermission . result . value , expectedDefaultState )
87-
8866 const origin = await script . callFunctionInBrowsingContext ( context . id , GET_ORIGIN , true , [ ] )
8967
9068 const originValue = origin . result . value
0 commit comments