mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 989137 - Part 13: Rename functions for associating with Add-on Manager; r=gfritzsche
The previous experiment feature expands the scope of these functions. A rename was in order. --HG-- extra : rebase_source : 054d7a440e3e15436ff7fbcbc4f91b28dd4fc9fd
This commit is contained in:
parent
2526b290b7
commit
bfb1f73953
@ -376,7 +376,7 @@ Experiments.Experiments.prototype = {
|
|||||||
AsyncShutdown.profileBeforeChange.addBlocker("Experiments.jsm shutdown",
|
AsyncShutdown.profileBeforeChange.addBlocker("Experiments.jsm shutdown",
|
||||||
this.uninit.bind(this));
|
this.uninit.bind(this));
|
||||||
|
|
||||||
this._startWatchingAddons();
|
this._registerWithAddonManager();
|
||||||
|
|
||||||
this._loadTask = Task.spawn(this._loadFromCache.bind(this));
|
this._loadTask = Task.spawn(this._loadFromCache.bind(this));
|
||||||
this._loadTask.then(
|
this._loadTask.then(
|
||||||
@ -406,7 +406,7 @@ Experiments.Experiments.prototype = {
|
|||||||
yield this._loadTask;
|
yield this._loadTask;
|
||||||
|
|
||||||
if (!this._shutdown) {
|
if (!this._shutdown) {
|
||||||
this._stopWatchingAddons();
|
this._unregisterWithAddonManager();
|
||||||
|
|
||||||
gPrefs.ignore(PREF_LOGGING, configureLogging);
|
gPrefs.ignore(PREF_LOGGING, configureLogging);
|
||||||
gPrefs.ignore(PREF_MANIFEST_URI, this.updateManifest, this);
|
gPrefs.ignore(PREF_MANIFEST_URI, this.updateManifest, this);
|
||||||
@ -427,12 +427,14 @@ Experiments.Experiments.prototype = {
|
|||||||
this._log.info("Completed uninitialization.");
|
this._log.info("Completed uninitialization.");
|
||||||
}),
|
}),
|
||||||
|
|
||||||
_startWatchingAddons: function () {
|
_registerWithAddonManager: function () {
|
||||||
|
this._log.trace("Registering instance with Addon Manager.");
|
||||||
|
|
||||||
AddonManager.addAddonListener(this);
|
AddonManager.addAddonListener(this);
|
||||||
AddonManager.addInstallListener(this);
|
AddonManager.addInstallListener(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
_stopWatchingAddons: function () {
|
_unregisterWithAddonManager: function () {
|
||||||
AddonManager.removeInstallListener(this);
|
AddonManager.removeInstallListener(this);
|
||||||
AddonManager.removeAddonListener(this);
|
AddonManager.removeAddonListener(this);
|
||||||
},
|
},
|
||||||
|
@ -1366,9 +1366,9 @@ add_task(function* testUnknownExperimentsUninstalled() {
|
|||||||
Assert.equal(addons.length, 0, "Precondition: No experiment add-ons are present.");
|
Assert.equal(addons.length, 0, "Precondition: No experiment add-ons are present.");
|
||||||
|
|
||||||
// Simulate us not listening.
|
// Simulate us not listening.
|
||||||
experiments._stopWatchingAddons();
|
experiments._unregisterWithAddonManager();
|
||||||
yield AddonTestUtils.installXPIFromURL(gDataRoot + EXPERIMENT1_XPI_NAME, EXPERIMENT1_XPI_SHA1);
|
yield AddonTestUtils.installXPIFromURL(gDataRoot + EXPERIMENT1_XPI_NAME, EXPERIMENT1_XPI_SHA1);
|
||||||
experiments._startWatchingAddons();
|
experiments._registerWithAddonManager();
|
||||||
|
|
||||||
addons = yield getExperimentAddons();
|
addons = yield getExperimentAddons();
|
||||||
Assert.equal(addons.length, 1, "Experiment 1 installed via AddonManager");
|
Assert.equal(addons.length, 1, "Experiment 1 installed via AddonManager");
|
||||||
@ -1452,9 +1452,9 @@ add_task(function* testEnabledAfterRestart() {
|
|||||||
Assert.ok(addons[0].isActive, "That experiment is active.");
|
Assert.ok(addons[0].isActive, "That experiment is active.");
|
||||||
|
|
||||||
dump("Restarting Addon Manager\n");
|
dump("Restarting Addon Manager\n");
|
||||||
experiments._stopWatchingAddons();
|
experiments._unregisterWithAddonManager();
|
||||||
restartManager();
|
restartManager();
|
||||||
experiments._startWatchingAddons();
|
experiments._registerWithAddonManager();
|
||||||
|
|
||||||
addons = yield getExperimentAddons();
|
addons = yield getExperimentAddons();
|
||||||
Assert.equal(addons.length, 1, "The experiment is still there after restart.");
|
Assert.equal(addons.length, 1, "The experiment is still there after restart.");
|
||||||
|
Loading…
Reference in New Issue
Block a user