Revision 29ad6b8c4b678cdb1ab4649f8b3acf54cd56bccc authored by Anne van Kesteren on 24 September 2018, 14:41:07 UTC, committed by Anne van Kesteren on 24 September 2018, 14:41:07 UTC
For https://github.com/httpwg/http-core/issues/136.
1 parent 00c1fd9
Raw File
wakelock-api.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Wake Lock API Test</title>
<link rel="help" href="https://w3c.github.io/wake-lock/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script>

promise_test(async t => {
  assert_true("getWakeLock" in navigator, "Wake Lock API is present");
  const wakeLock = await navigator.getWakeLock("screen");
  const request = wakeLock.createRequest();
  assert_true(wakeLock instanceof WakeLock, "wakeLock is a WakeLock");
  assert_equals(typeof wakeLock.type, "string", "the type of wakeLock.type is string");
  assert_equals(typeof wakeLock.active, "boolean", "the type of wakeLock.active is boolean");
  assert_true(request instanceof WakeLockRequest, "request is a WakeLockRequest");
}, "Test that the Wake Lock API is correct");

</script>
back to top