Skip to content

Commit

Permalink
Add permission test for push api (#33200)
Browse files Browse the repository at this point in the history
* Add permission test for push api

* Add marcoscaceres to reviewers for Push API

* Copy/pasta
  • Loading branch information
marcoscaceres committed Mar 16, 2022
1 parent ac5e98e commit 93068ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions push-api/META.yml
@@ -1,3 +1,4 @@
spec: https://w3c.github.io/push-api/
suggested_reviewers:
- beverloo
- marcoscaceres
14 changes: 14 additions & 0 deletions push-api/permission.https.html
@@ -0,0 +1,14 @@
<!doctype html>
<meta charset=utf-8>
<title>Test push is a powerful feature via Permissions API</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>

<script>
promise_test(async (test) => {
const status = await navigator.permissions.query({ name: "push" });
assert_true(status instanceof PermissionStatus);
assert_equals(status.name, "push", `permission's name must be "push"`);
assert_equals(status.state, "prompt", `permission's state must be "prompt" by default`);
}, `Query "push" powerful feature`);
</script>

0 comments on commit 93068ae

Please sign in to comment.