Bug 1770047 [wpt PR 34117] - [Clipboard API] Clipboard Web Custom Formats implementat...
[gecko.git] / testing / web-platform / tests / clipboard-apis / permissions / readText-denied.https.html
blob010f4ba21b95332c3fabb59c2861b634e1ea48ee
1 <!doctype html>
2 <meta charset="utf-8">
3 <title>navigator.clipboard.readText() fails when permission denied</title>
4 <link rel="help" href="https://w3c.github.io/clipboard-apis/#async-clipboard-api">
5 <body>Body needed for test_driver.click()</body>
6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
8 <script src="/resources/testdriver.js"></script>
9 <script src="/resources/testdriver-vendor.js"></script>
10 <script src="../resources/user-activation.js"></script>
11 <script>
12 'use strict';
14 promise_test(async t => {
15 await test_driver.set_permission({name: 'clipboard-read'}, 'denied');
16 await waitForUserActivation();
17 await promise_rejects_dom(t,
18 'NotAllowedError', navigator.clipboard.readText());
19 }, 'navigator.clipboard.readText() fails when permission denied');
20 </script>