mirror of
https://github.com/servo/servo.git
synced 2025-08-14 09:55:35 +01:00
Update web-platform-tests to revision 7d24adef541b2e836f2b2f9534ce3f0e078f5782
This commit is contained in:
parent
9fb83d8143
commit
bd54acb29d
15749 changed files with 178578 additions and 425713 deletions
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>sensor: permission</title>
|
||||
<link rel="help" href="https://w3c.github.io/sensors/"/>
|
||||
<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>
|
||||
|
||||
"use strict";
|
||||
|
||||
for (const entry of ['accelerometer', 'gyroscope',
|
||||
'magnetometer', 'ambient-light-sensor']) {
|
||||
promise_test(async t => {
|
||||
await test_driver.set_permission({ name: entry }, 'denied', false);
|
||||
|
||||
const status = await navigator.permissions.query({ name: entry });
|
||||
assert_class_string(status, "PermissionStatus");
|
||||
assert_equals(status.state, "denied");
|
||||
}, `Deny ${entry} permission should work.`);
|
||||
|
||||
promise_test(async t => {
|
||||
await test_driver.set_permission({ name: entry }, 'granted', false);
|
||||
|
||||
const status = await navigator.permissions.query({ name: entry });
|
||||
assert_class_string(status, "PermissionStatus");
|
||||
assert_equals(status.state, "granted");
|
||||
}, `Grant ${entry} permission should work.`);
|
||||
};
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue