mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Update web-platform-tests to revision c2e5b9fbaa17424f05ca2bb04609790a3b61d5c2
This commit is contained in:
parent
db7bb2a510
commit
f2c1b70e4a
138 changed files with 2799 additions and 851 deletions
|
@ -8,18 +8,21 @@
|
|||
<script>
|
||||
|
||||
promise_test(async t => {
|
||||
const wakeLock = await navigator.getWakeLock("screen");
|
||||
const wakeLock = new WakeLock("screen");
|
||||
const eventWatcher = new EventWatcher(t, wakeLock, "activechange");
|
||||
assert_false(wakeLock.active, "the active is false before wake lock is acquired");
|
||||
|
||||
let request = wakeLock.createRequest();
|
||||
const controller = new AbortController();
|
||||
const signal = controller.signal;
|
||||
|
||||
await wakeLock.request({ signal });
|
||||
let evt1 = await eventWatcher.wait_for("activechange");
|
||||
assert_true(evt1.isTrusted && !evt1.bubbles && !evt1.cancelable && evt1 instanceof Event, "a simple event is fired");
|
||||
assert_equals(evt1.type, "activechange", "the event name is 'activechange'");
|
||||
assert_equals(evt1.target, wakeLock, "event.target is WakeLock.");
|
||||
assert_true(wakeLock.active, "the active is true when wake lock is acquired");
|
||||
|
||||
request.cancel();
|
||||
controller.abort();
|
||||
let evt2 = await eventWatcher.wait_for("activechange");
|
||||
assert_true(evt2.isTrusted && !evt2.bubbles && !evt2.cancelable && evt2 instanceof Event, "a simple event is fired");
|
||||
assert_false(wakeLock.active, "the active is false when wake lock is released");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue