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>