Revision 7a44da74a0dc0c711f89fc8ddbe55fb97e0b0e4a authored by kritisingh1 on 26 March 2018, 09:33:08 UTC, committed by kritisingh1 on 26 March 2018, 09:33:08 UTC
1 parent fe7370b
Raw File
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