summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/screen-details/permission.https.window.js
blob: f477bd4230bbfa99d5020393eb8bf9f794b5e8ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// META: global=window
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
"use strict";

promise_test(async t => {
  await test_driver.set_permission({ name: "window-management" }, "denied");

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

promise_test(async t => {
  await test_driver.set_permission({ name: "window-management" }, "granted");

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