-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1902601 [wpt PR 46745] - Geolocation: small cleanup of tests, a=t…
…estonly Automatic update from web-platform-tests Geolocation: small cleanup of tests (#46745) -- wpt-commits: 3334c5af355473a7416266b978198d4c586f0cfd wpt-pr: 46745
- Loading branch information
1 parent
dc6e960
commit 5a4695c
Showing
3 changed files
with
25 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 18 additions & 10 deletions
28
testing/web-platform/tests/geolocation/permission.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>Test geolocation is a powerful feature via Permissions API</title> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<script> | ||
promise_test(async (test) => { | ||
const status = await navigator.permissions.query({ name: "geolocation" }); | ||
assert_true(status instanceof PermissionStatus); | ||
assert_equals(status.name, "geolocation", `permission's name must be "geolocation"`); | ||
assert_equals(status.state, "prompt", `permission's state must be "prompt" by default`); | ||
}, `Query "geolocation" powerful feature`); | ||
promise_test(async (test) => { | ||
const status = await navigator.permissions.query({ name: "geolocation" }); | ||
assert_true(status instanceof PermissionStatus); | ||
assert_equals( | ||
status.name, | ||
"geolocation", | ||
`permission's name must be "geolocation"` | ||
); | ||
const states = ["prompt", "granted", "denied"]; | ||
assert_true( | ||
states.includes(status.state), | ||
`permission's state must be one of ${states.join(", ")}` | ||
); | ||
}, `Query "geolocation" powerful feature`); | ||
</script> |