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-cancel-twice.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>no exception is thrown when invoking cancel() twice</title>
<link rel="help" href="https://w3c.github.io/wake-lock/#dom-wakelockrequest-cancel">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

promise_test(async t => {
  const wakeLock = await navigator.getWakeLock("screen");
  const request = wakeLock.createRequest();
  assert_true(wakeLock.active, "the activate is true when wake lock is acquired");
  request.cancel();
  assert_false(wakeLock.active, "the activate is false when wake lock is released");
  //If the cancel() method has already been invoked on this object,
  //abort these steps, no error fired
  request.cancel();
}, "no exception is thrown when invoking cancel() twice");

</script>
back to top