mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
20 lines
841 B
HTML
20 lines
841 B
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>
|