mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 995438 - Call SpecialPowers.pushPermissions() to ensure permission change is completed before continuing the rest of the tests. r=baku
This commit is contained in:
parent
52d76c7560
commit
572c687e06
@ -39,7 +39,7 @@ function testAudioPlayPause() {
|
||||
audio.pause();
|
||||
});
|
||||
|
||||
navigator.mozPower.addWakeLockListener(function testAudioPlayListener(topic, state) {
|
||||
function testAudioPlayListener(topic, state) {
|
||||
is(topic, "cpu", "Audio element locked the target == cpu");
|
||||
var locked = state == "locked-foreground" ||
|
||||
state == "locked-background";
|
||||
@ -58,8 +58,9 @@ function testAudioPlayPause() {
|
||||
navigator.mozPower.removeWakeLockListener(testAudioPlayListener);
|
||||
runTests();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
navigator.mozPower.addWakeLockListener(testAudioPlayListener);
|
||||
audio.play();
|
||||
}
|
||||
|
||||
@ -78,7 +79,7 @@ function testAudioPlay() {
|
||||
startDate = new Date();
|
||||
});
|
||||
|
||||
navigator.mozPower.addWakeLockListener(function testAudioPlayListener(topic, state) {
|
||||
function testAudioPlayListener(topic, state) {
|
||||
is(topic, "cpu", "Audio element locked the target == cpu");
|
||||
var locked = state == "locked-foreground" ||
|
||||
state == "locked-background";
|
||||
@ -101,8 +102,9 @@ function testAudioPlay() {
|
||||
navigator.mozPower.removeWakeLockListener(testAudioPlayListener);
|
||||
runTests();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
navigator.mozPower.addWakeLockListener(testAudioPlayListener);
|
||||
audio.play();
|
||||
}
|
||||
|
||||
@ -117,8 +119,11 @@ function runTests() {
|
||||
test();
|
||||
};
|
||||
|
||||
SpecialPowers.addPermission("power", true, document);
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests);
|
||||
SpecialPowers.pushPermissions(
|
||||
[{'type': 'power', 'allow': true, 'context': document}],
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests);
|
||||
});
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user