mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 562803: Add cleanup function to avoid one failing xpinstall test from messing up subsequent tests. r=robstrong
This commit is contained in:
parent
6b36c3e919
commit
8cc29264a1
@ -63,19 +63,18 @@ var Harness = {
|
|||||||
AddonManager.addInstallListener(this);
|
AddonManager.addInstallListener(this);
|
||||||
this.installCount = 0;
|
this.installCount = 0;
|
||||||
this.pendingCount = 0;
|
this.pendingCount = 0;
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
registerCleanupFunction(function() {
|
||||||
|
Services.prefs.clearUserPref(PREF_LOGGING_ENABLED);
|
||||||
|
Services.obs.removeObserver(self, "addon-install-blocked");
|
||||||
|
Services.wm.removeListener(self);
|
||||||
|
|
||||||
|
AddonManager.removeInstallListener(self);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
finish: function() {
|
finish: function() {
|
||||||
Services.prefs.clearUserPref(PREF_LOGGING_ENABLED);
|
|
||||||
Services.obs.removeObserver(this, "addon-install-blocked");
|
|
||||||
Services.wm.removeListener(this);
|
|
||||||
|
|
||||||
var win = Services.wm.getMostRecentWindow("Extension:Manager");
|
|
||||||
if (win)
|
|
||||||
win.close();
|
|
||||||
|
|
||||||
AddonManager.removeInstallListener(this);
|
|
||||||
|
|
||||||
AddonManager.getAllInstalls(function(installs) {
|
AddonManager.getAllInstalls(function(installs) {
|
||||||
is(installs.length, 0, "Should be no active installs at the end of the test");
|
is(installs.length, 0, "Should be no active installs at the end of the test");
|
||||||
finish();
|
finish();
|
||||||
|
Loading…
Reference in New Issue
Block a user