mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00
Bug 849764 - Replace removeObserver() calls with three params with two in storage dir. r=mak
This commit is contained in:
parent
1048baca16
commit
a8e6ef988a
@ -108,17 +108,17 @@ function test_common_vacuum()
|
||||
print("\n*** Test that a VACUUM correctly happens and all notifications are fired.");
|
||||
// Wait for VACUUM begin.
|
||||
let beginVacuumReceived = false;
|
||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
||||
Services.obs.removeObserver(arguments.callee, aTopic, false);
|
||||
Services.obs.addObserver(function onVacuum(aSubject, aTopic, aData) {
|
||||
Services.obs.removeObserver(onVacuum, aTopic);
|
||||
beginVacuumReceived = true;
|
||||
}, "test-begin-vacuum", false);
|
||||
|
||||
// Wait for heavy IO notifications.
|
||||
let heavyIOTaskBeginReceived = false;
|
||||
let heavyIOTaskEndReceived = false;
|
||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
||||
Services.obs.addObserver(function onVacuum(aSubject, aTopic, aData) {
|
||||
if (heavyIOTaskBeginReceived && heavyIOTaskEndReceived) {
|
||||
Services.obs.removeObserver(arguments.callee, aTopic, false);
|
||||
Services.obs.removeObserver(onVacuum, aTopic);
|
||||
}
|
||||
|
||||
if (aData == "vacuum-begin") {
|
||||
@ -130,8 +130,8 @@ function test_common_vacuum()
|
||||
}, "heavy-io-task", false);
|
||||
|
||||
// Wait for VACUUM end.
|
||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
||||
Services.obs.removeObserver(arguments.callee, aTopic, false);
|
||||
Services.obs.addObserver(function onVacuum(aSubject, aTopic, aData) {
|
||||
Services.obs.removeObserver(onVacuum, aTopic);
|
||||
print("Check we received onBeginVacuum");
|
||||
do_check_true(beginVacuumReceived);
|
||||
print("Check we received heavy-io-task notifications");
|
||||
|
Loading…
x
Reference in New Issue
Block a user