DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (c68fe15a81fc)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<!DOCTYPE html>
<meta charset=utf-8>
<title>Web NFC: permission</title>
<title>Web NFC: permission</title>
<link rel="help" href="https://w3c.github.io/web-nfc/"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script>

"use strict";

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

  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', false);

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

</script>