servo/tests/wpt/web-platform-tests/wake-lock/wakelock-promise.https.html

13 lines
591 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>navigator.getWakeLock() for the same Document always return same WakeLock promise</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 => {
const wakeLock1 = await navigator.getWakeLock("screen");
const wakeLock2 = await navigator.getWakeLock("screen");
assert_equals(wakeLock1, wakeLock2);
}, "navigator.getWakeLock() for the same Document always return same WakeLock promise");
</script>