Skip to content

Commit 595d3c7

Browse files
rename test file
1 parent 05b1ced commit 595d3c7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

geolocation/success.https.html renamed to geolocation/getCurrentPosition-success.https.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
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;
@@ -27,14 +28,13 @@
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);

0 commit comments

Comments
 (0)