Point other profiles to new data dir after migration (+ code reorg)

Look for other profiles, from both apps (Firefox and Standalone), that
point to the data directory being migrated and update prefs.js in those
profiles to point to the new location.

Also reorganize code into Zotero.Profile and Zotero.DataDirectory
namespaces
This commit is contained in:
Dan Stillman 2016-11-26 22:41:26 -05:00
parent c0bf2b91f6
commit 4c0abb6816
13 changed files with 1338 additions and 919 deletions

View file

@ -79,7 +79,7 @@ describe("Zotero.Sync.Data.Local", function() {
// extra1 functionality not used at the moment
it.skip("should prompt for data reset and allow to choose a new data directory", function* (){
sinon.stub(Zotero, 'forceNewDataDirectory').returns(true);
sinon.stub(Zotero.DataDirectory, 'forceChange').returns(true);
yield Zotero.Users.setCurrentUserID(1);
yield Zotero.Users.setCurrentUsername("A");
@ -88,10 +88,10 @@ describe("Zotero.Sync.Data.Local", function() {
var cont = yield Zotero.Sync.Data.Local.checkUser(window, 2, "B");
var resetDataDirFileExists = yield OS.File.exists(resetDataDirFile);
assert.isTrue(cont);
assert.isTrue(Zotero.forceNewDataDirectory.called);
assert.isTrue(Zotero.DataDirectory.forceChange.called);
assert.isFalse(resetDataDirFileExists);
Zotero.forceNewDataDirectory.restore();
Zotero.DataDirectory.forceChange.restore();
});
});