summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/web-nfc/nfc_permission.https.window.js
blob: 9cb4209d2f49a9ab104c8c5db66273c5acdc943d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js

'use strict';

promise_test(async t => {
  await test_driver.set_permission({name: 'nfc'}, 'denied');

  const status = await navigator.permissions.query({name: 'nfc'});
  assert_class_string(status, 'PermissionStatus');
  assert_equals(status.state, 'denied');
}, 'Deny nfc permission should work.');

promise_test(async t => {
  await test_driver.set_permission({name: 'nfc'}, 'granted');

  const status = await navigator.permissions.query({name: 'nfc'});
  assert_class_string(status, 'PermissionStatus');
  assert_equals(status.state, 'granted');
}, 'Grant nfc permission should work.');