Bug 1588002 - Make sure to remove every nsIDOMMozWakeLockListener added by browser_media_wakelock.js even if a notification is not seen. r=alwu

Differential Revision: https://phabricator.services.mozilla.com/D48931

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Conley 2019-10-28 20:41:36 +00:00
Родитель 25d20e8373
Коммит 315a7c522c
2 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -156,9 +156,7 @@ support-files =
file_videoWithoutAudioTrack.html
gizmo.mp4
gizmo-noaudio.webm
skip-if =
(os == "win" && processor == "aarch64") || # aarch64 due to 1536573
(fission && debug) # Leaks the world under Fission.
skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573
[browser_mute.js]
tags = audiochannel
skip-if = (os == "win" && processor == "aarch64") # aarch64 due to 1536573

Просмотреть файл

@ -35,10 +35,9 @@ function wakeLockObserved(observeTopic, checkFn) {
function getWakeLockState(topic, needLock, isTabInForeground) {
const tabState = isTabInForeground ? "foreground" : "background";
const promise = wakeLockObserved(
topic,
state => state == `locked-${tabState}`
);
const promise = needLock
? wakeLockObserved(topic, state => state == `locked-${tabState}`)
: null;
return {
check: async () => {
if (needLock) {