зеркало из https://github.com/mozilla/gecko-dev.git
Bug 617478: clear CollectionKeys on startOver. r=philiKON.
This commit is contained in:
Родитель
d9a0b60f3c
Коммит
df46a7337e
|
@ -168,6 +168,13 @@ function CollectionKeyManager() {
|
|||
// Note that the last modified time needs to be preserved.
|
||||
CollectionKeyManager.prototype = {
|
||||
|
||||
clear: function clear() {
|
||||
this._log.info("Clearing CollectionKeys...");
|
||||
this._lastModified = 0;
|
||||
this._collections = {};
|
||||
this._default = null;
|
||||
},
|
||||
|
||||
keyForCollection: function(collection) {
|
||||
|
||||
// Moderately temporary debugging code.
|
||||
|
|
|
@ -845,6 +845,9 @@ WeaveSvc.prototype = {
|
|||
Svc.Prefs.resetBranch("");
|
||||
this._ignorePrefObserver = false;
|
||||
|
||||
// Clear keys.
|
||||
CollectionKeys.clear();
|
||||
|
||||
Svc.Prefs.set("lastversion", WEAVE_VERSION);
|
||||
// Find weave logins and remove them.
|
||||
this.password = "";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
Cu.import("resource://services-sync/base_records/crypto.js");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
|
@ -62,6 +63,14 @@ function test_withEngineList() {
|
|||
}
|
||||
}
|
||||
|
||||
function test_startOver_clears_keys() {
|
||||
CollectionKeys.generateNewKeys();
|
||||
do_check_true(!!CollectionKeys.keyForCollection());
|
||||
Service.startOver();
|
||||
do_check_false(!!CollectionKeys.keyForCollection());
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
test_withEngineList();
|
||||
test_startOver_clears_keys();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче