mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00: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
ff424e7f8f
commit
52c25f2ca7
@ -63,19 +63,18 @@ var Harness = {
|
||||
AddonManager.addInstallListener(this);
|
||||
this.installCount = 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() {
|
||||
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) {
|
||||
is(installs.length, 0, "Should be no active installs at the end of the test");
|
||||
finish();
|
||||
|
Loading…
Reference in New Issue
Block a user