Bug 930967 - Follow-up to fix mistake in test suite that lead to intermittent failures r=me

From 7531ffe0cfebf5296b063538922c12fb83bfb8f7 Mon Sep 17 00:00:00 2001
This commit is contained in:
Tim Taubert 2013-11-23 09:08:26 +01:00
parent 9b8de13fb1
commit a9bef43543

View File

@ -191,20 +191,20 @@ function promiseContentMessage(browser, name, timeout = 1000) {
mm.removeMessageListener(name, listener);
}
let timeout = setTimeout(function () {
let timeoutID = setTimeout(function () {
removeListener();
deferred.resolve(false);
}, timeout);
function listener(msg) {
removeListener();
clearTimeout(timeout);
clearTimeout(timeoutID);
deferred.resolve(msg);
}
registerCleanupFunction(function() {
removeListener();
clearTimeout(timeout);
clearTimeout(timeoutID);
});
mm.addMessageListener(name, listener);