зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
b07d2488db
Коммит
b1016b8cff
|
@ -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();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче