Bug 1177013 - Add-on install test changes (r=mrbkap)

This commit is contained in:
Bill McCloskey 2015-06-19 16:05:20 -07:00
parent 671b16822e
commit bf88274458

View File

@ -287,15 +287,17 @@ var Harness = {
if (this.finalContentEvent && !this.waitingForEvent) {
this.waitingForEvent = true;
info("Waiting for " + this.finalContentEvent);
let mm = gBrowser.selectedBrowser.messageManager;
mm.loadFrameScript(`data:,content.addEventListener("${this.finalContentEvent}", () => { sendAsyncMessage("Test:GotNewInstallEvent"); });`, false);
let win = gBrowser.contentWindow;
let listener = () => {
info("Saw " + this.finalContentEvent);
win.removeEventListener(this.finalContentEvent, listener, false);
mm.removeMessageListener("Test:GotNewInstallEvent", listener);
this.waitingForEvent = false;
if (this.pendingCount == 0)
this.endTest();
}
win.addEventListener(this.finalContentEvent, listener, false);
mm.addMessageListener("Test:GotNewInstallEvent", listener);
}
},