Backed out changeset dd0d02c1ee7c (bug 766325) for xpcshell bustage

This commit is contained in:
Gregory Szorc 2012-06-23 18:38:41 -07:00
Родитель 808439fa18
Коммит d029fbeb56
5 изменённых файлов: 19 добавлений и 19 удалений

Просмотреть файл

@ -97,7 +97,7 @@ AitcClient.prototype = {
app.name = "Uninstalled"; // Bug 760262
let record = this._makeRemoteApp(app);
record.hidden = true;
record.deleted = true;
this._putApp(record, cb);
},
@ -235,8 +235,8 @@ AitcClient.prototype = {
manifestURL: app.manifestPath,
receipts: app.receipts
};
if ("hidden" in app) {
record.hidden = app.hidden;
if ("deleted" in app) {
record.deleted = app.deleted;
}
return record;
},
@ -384,4 +384,4 @@ AitcClient.prototype = {
this._state.set("backoff", "" + (time + backoff));
}
},
};
};

Просмотреть файл

@ -382,7 +382,7 @@ AitcManager.prototype = {
this._client.remoteInstall(record.app, _clientCallback);
break;
case "uninstall":
record.app.hidden = true;
record.app.deleted = true;
this._client.remoteUninstall(record.app, _clientCallback);
break;
default:

Просмотреть файл

@ -257,11 +257,11 @@ AitcStorageImpl.prototype = {
* 2. Put all local apps in a dictionary of origin->app.
* 3. Mark all local apps as "to be deleted".
* 4. Go through each remote app:
* 4a. If remote app is not marked as hidden, remove from the "to be
* 4a. If remote app is not marked as deleted, remove from the "to be
* deleted" set.
* 4b. If remote app is marked as hidden, but isn't present locally,
* 4b. If remote app is marked as deleted, but isn't present locally,
* process the next remote app.
* 4c. If remote app is not marked as hidden and isn't present locally,
* 4c. If remote app is not marked as deleted and isn't present locally,
* add to the "to be installed" set.
* 5. For each app either in the "to be installed" or "to be deleted" set,
* apply the changes locally. For apps to be installed, we must also
@ -275,7 +275,7 @@ AitcStorageImpl.prototype = {
// If remoteApps is empty, do nothing. The correct thing to do is to
// delete all local apps, but we'll play it safe for now since we are
// marking apps as deleted anyway. In a subsequent version (when the
// hidden flag is no longer in use), this check can be removed.
// deleted flag is no longer in use), this check can be removed.
if (!Object.keys(remoteApps).length) {
this._log.warn("Empty set of remote apps to _processApps, returning");
callback();
@ -294,12 +294,12 @@ AitcStorageImpl.prototype = {
for each (let app in remoteApps) {
// Don't delete apps that are both local & remote.
let origin = app.origin;
if (!app.hidden) {
if (!app.deleted) {
delete toDelete[origin];
}
// A remote app that was hidden, but also isn't present locally is NOP.
if (app.hidden && !localApps[origin]) {
// A remote app that was deleted, but also isn't present locally is NOP.
if (app.deleted && !localApps[origin]) {
continue;
}
@ -320,10 +320,10 @@ AitcStorageImpl.prototype = {
}
}
// Uninstalls only need the ID & hidden flag.
// Uninstalls only need the ID & deleted flag.
let toUninstall = [];
for (let origin in toDelete) {
toUninstall.push({id: toDelete[origin].id, hidden: true});
toUninstall.push({id: toDelete[origin].id, deleted: true});
}
// Apply uninstalls first, we do not need to fetch manifests.
@ -449,4 +449,4 @@ AitcStorageImpl.prototype = {
XPCOMUtils.defineLazyGetter(this, "AitcStorage", function() {
return new AitcStorageImpl();
});
});

Просмотреть файл

@ -104,8 +104,8 @@ add_test(function test_storage_install() {
});
add_test(function test_storage_uninstall() {
// Set app1 as hidden.
fakeApp1.hidden = true;
// Set app1 as deleted.
fakeApp1.deleted = true;
AitcStorage.processApps([fakeApp2], function() {
// It should be missing.
do_check_eq(DOMApplicationRegistry._appId(fakeApp1.origin), null);
@ -121,4 +121,4 @@ add_test(function test_storage_uninstall_empty() {
do_check_eq(DOMApplicationRegistry._appId(fakeApp2.origin), null);
run_next_test();
});
});
});

Просмотреть файл

@ -38,7 +38,7 @@ AITCServer10User.prototype = {
modifiedAt: true,
receipts: true,
name: true,
hidden: true,
deleted: true,
},
requiredAppProperties: [