Bug 570152 - engine.js tests should completely reset preferences [r=mconnor]

Switch to resetBranch("") instead of resetting individual prefs.
This commit is contained in:
Philipp von Weitershausen 2010-06-04 16:38:38 +01:00
parent 66a57fc0d9
commit c0bcc6524a
3 changed files with 18 additions and 31 deletions

View File

@ -136,7 +136,7 @@ function test_enabled() {
engine.enabled = false;
do_check_false(Svc.Prefs.get("engine.steam"));
} finally {
Svc.Prefs.reset("engine.steam");
Svc.Prefs.resetBranch("");
}
}
@ -156,7 +156,7 @@ function test_sync() {
do_check_eq(engineObserver.topics[0], "weave:engine:sync:start");
do_check_eq(engineObserver.topics[1], "weave:engine:sync:finish");
} finally {
Svc.Prefs.reset("engine.steam");
Svc.Prefs.resetBranch("");
engine.wasSynced = false;
engineObserver.reset();
}

View File

@ -18,7 +18,7 @@ function test_url_attributes() {
"https://cluster/1.0/foo/storage/crypto/steam");
do_check_eq(engine.metaURL, "https://cluster/1.0/foo/storage/meta/global");
} finally {
Svc.Prefs.reset("clusterURL");
Svc.Prefs.resetBranch("");
}
}
@ -37,7 +37,7 @@ function test_syncID() {
do_check_eq(Svc.Prefs.get("steam.syncID"), "fake-guid-1");
do_check_eq(engine.syncID, "fake-guid-1");
} finally {
Svc.Prefs.reset("steam.syncID");
Svc.Prefs.resetBranch("");
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
}
}
@ -60,7 +60,7 @@ function test_lastSync() {
do_check_eq(engine.lastSync, 0);
do_check_eq(Svc.Prefs.get("steam.lastSync"), "0");
} finally {
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
}
}
@ -108,6 +108,6 @@ function test_resetClient() {
do_check_eq(engine.toFetch.length, 0);
} finally {
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
}
}

View File

@ -223,9 +223,7 @@ function test_syncStartup_emptyOrOutdatedGlobalsResetsSync() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.syncID");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -257,7 +255,7 @@ function test_syncStartup_serverHasNewerVersion() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.resetBranch("");
Records.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
}
@ -300,9 +298,7 @@ function test_syncStartup_syncIDMismatchResetsClient() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.syncID");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -371,9 +367,7 @@ function test_syncStartup_badKeyWipesServerData() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.syncID");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -404,8 +398,7 @@ function test_processIncoming_emptyServer() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -458,8 +451,7 @@ function test_processIncoming_createFromServer() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -580,8 +572,7 @@ function test_processIncoming_reconcile() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -686,9 +677,7 @@ function test_processIncoming_fetchNum() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("client.type");
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -742,8 +731,7 @@ function test_uploadOutgoing_toEmptyServer() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -800,8 +788,7 @@ function test_uploadOutgoing_MAX_UPLOAD_RECORDS() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.reset("steam.lastSync");
Svc.Prefs.resetBranch("");
Records.clearCache();
CryptoMetas.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
@ -856,7 +843,7 @@ function test_syncFinish_deleteByIds() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.resetBranch("");
Records.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
}
@ -928,7 +915,7 @@ function test_syncFinish_deleteLotsInBatches() {
} finally {
server.stop(function() {});
Svc.Prefs.reset("clusterURL");
Svc.Prefs.resetBranch("");
Records.clearCache();
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
}