File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1212 descriptor : { name : "geolocation" } ,
1313 state : "granted" ,
1414 } ) ;
15-
16- // Ensure any previously set geolocation emulations are cleared.
17- await test_driver . bidi . emulation . set_geolocation_override (
18- { coordinates : null } ) ;
1915 } ) ;
2016
21- promise_test ( async ( ) => {
17+ promise_test ( async ( t ) => {
18+ t . add_cleanup ( async ( ) => {
19+ await test_driver . bidi . emulation . set_geolocation_override (
20+ { coordinates : null } ) ;
21+ } ) ;
22+
2223 const latitude = 51.478 ;
2324 const longitude = - 0.166 ;
2425 const accuracy = 100 ;
2728 coordinates : { latitude, longitude, accuracy}
2829 } ) ;
2930
30- const positionPromise = new Promise (
31+ const position = await new Promise (
3132 ( resolve , reject ) =>
3233 window . navigator . geolocation . getCurrentPosition (
3334 position => resolve ( position . coords . toJSON ( ) ) ,
3435 error => reject ( error ) ,
3536 { timeout : 200 }
36- ) )
37- const position = await positionPromise ;
37+ ) ) ;
3838
3939 assert_equals ( position . latitude , latitude ) ;
4040 assert_equals ( position . longitude , longitude ) ;
You can’t perform that action at this time.
0 commit comments