Revision d82577659f6502e95610c654b65ea20a76b22baa authored by David Grogan on 06 July 2018, 23:21:12 UTC, committed by Chrome-bot on 06 July 2018, 23:21:12 UTC
Note this is a test only, the bug persists.

Bug: 860084
Change-Id: I89d0cabda6018beaef2ec33ee8eb96b44a86e1c8
1 parent e7283ac
Raw File
interfaces.any.js
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

"use strict";

if (self.importScripts) {
  importScripts("/resources/testharness.js");
  importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js");
}

// https://w3c.github.io/permissions/#idl-index

promise_test(async () => {
  const idl = await fetch("/interfaces/permissions.idl").then(r => r.text());
  const dom = await fetch("/interfaces/dom.idl").then(r => r.text());
  const html = await fetch("/interfaces/html.idl").then(r => r.text());

  const idl_array = new IdlArray();
  idl_array.add_idls(idl);
  idl_array.add_dependency_idls(dom);
  idl_array.add_dependency_idls(html);

  try {
    self.permissionStatus = await navigator.permissions.query({ name: "geolocation" });
  } catch (e) {
    // Will be surfaced in idlharness.js's test_object below.
  }

  if (self.GLOBAL.isWorker()) {
    idl_array.add_objects({ WorkerNavigator: ['navigator'] });
  } else {
    idl_array.add_objects({ Navigator: ['navigator'] });
  }

  idl_array.add_objects({
    Permissions: ['navigator.permissions'],
    PermissionStatus: ['permissionStatus']
  });
  idl_array.test();
}, "Test IDL implementation of Permissions API");
back to top