https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 7ca7cb4a359d31546505db3b4eb7feb90e69fa4a authored by Marijn Kruisselbrink on 24 May 2018, 23:04:36 UTC
[Mojo Blob URLs] Handle more navigation cases.
Tip revision: 7ca7cb4
interfaces.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Wake Lock API IDL tests</title>
<link rel="help" href="https://w3c.github.io/wake-lock/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<script>
"use strict";

promise_test(async () => {
  const idl_array = new IdlArray();
  const dom_idl = await fetch("/interfaces/dom.idl").then(r => r.text());
  const wakelock_idl = await fetch("/interfaces/wake-lock.idl").then(r => r.text());
  const wakelock = await navigator.getWakeLock("screen");

  idl_array.add_untested_idls(dom_idl);
  idl_array.add_untested_idls('interface EventHandler {};');
  idl_array.add_untested_idls('interface Navigator {};');
  idl_array.add_idls(wakelock_idl);

  window.wakelock = wakelock;
  window.request = wakelock.createRequest();

  idl_array.add_objects({
    Navigator: ['navigator'],
    WakeLock: ['wakelock'],
    WakeLockRequest: ['request']
  });
  idl_array.test();
}, "Test IDL implementation of WakeLock API");
</script>
back to top