blob: b5d764aee0d85e57b38ee5ff636d18e9c01c1dba [file] [log] [blame]
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// https://w3c.github.io/wake-lock/
'use strict';
idl_test(
['wake-lock'],
['dom', 'html', 'permissions'],
async idl_array => {
if (self.GLOBAL.isWorker()) {
idl_array.add_objects({ WorkerNavigator: ['navigator'] });
} else {
idl_array.add_objects({ Navigator: ['navigator'] });
}
idl_array.add_objects({
WakeLock: ['navigator.wakeLock'],
WakeLockSentinel: ['sentinel'],
});
// For now, this assumes the request will be granted and the promise will
// be fulfilled with a WakeLockSentinel object.
self.sentinel = await navigator.wakeLock.request('screen');
self.sentinel.release();
}
);