Revision e5dc8cdd0af144fc9566677f16b2b10fec07732f authored by kritisingh1 on 03 April 2018, 16:06:36 UTC, committed by kritisingh1 on 03 April 2018, 16:06:36 UTC
1 parent 7c51ebb
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_true(wakeLock.type instanceof WakeLockType, "wakeLock.type is a WakeLockType");
  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