-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Geolocation: small cleanup of tests (#46745)
- Loading branch information
1 parent
92e0291
commit 3334c5a
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
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> |
3334c5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run
Connect:SSL
3334c5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
** geht started**
3334c5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get started
3334c5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run #46002