Bug 1770047 [wpt PR 34117] - [Clipboard API] Clipboard Web Custom Formats implementat...
[gecko.git] / testing / web-platform / tests / web-share / disabled-by-permissions-policy.https.sub.html
blobe9ea903965032e4165beb31ef3311bc22f95f249
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8" />
5 <title>WebShare Test: Can be disabled by permissions policy</title>
6 <link rel="help" href="https://w3c.github.io/web-share/#permissions-policy">
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 <script src="/resources/testdriver.js"></script>
10 <script src="/resources/testdriver-vendor.js"></script>
11 </head>
12 <body>
13 <script>
14 promise_test(async (t) => {
15 await test_driver.bless("web share");
16 await promise_rejects_dom(t, "NotAllowedError", navigator.share({}));
17 }, "share() can be disabled by permissions policy");
19 test((t) => {
20 assert_false(
21 navigator.canShare({ text: "foo" }),
22 "not allowed to share"
24 }, "canShare() can be disabled by permissions policy");
25 </script>
26 </body>
27 </html>