Bug 1062107 - Fix system app listener removal. r=fabrice

This commit is contained in:
Alexandre Poirot 2014-09-04 03:04:00 +02:00
parent 3a05b506bd
commit 890a82a31b
2 changed files with 5 additions and 5 deletions

View File

@ -110,10 +110,10 @@ let SystemAppProxy = {
if (content) {
content.removeEventListener.apply(content, arguments);
} else {
let idx = this._pendingListeners.indexOf(listener);
if (idx != -1) {
this._pendingListeners.splice(idx, 1);
}
this._pendingListeners = this._pendingListeners.filter(
args => {
return args[0] != name || args[1] != listener;
});
}
},

View File

@ -94,7 +94,7 @@ let steps = [
// Ensure that listener being registered before the system app is ready
// are correctly removed from the pending list
function removedListener() {
assert(false, "Listener isn't correctly removed from the pending list");
assert.ok(false, "Listener isn't correctly removed from the pending list");
}
SystemAppProxy.addEventListener("mozChromeEvent", removedListener);
SystemAppProxy.removeEventListener("mozChromeEvent", removedListener);