Bug 738287 - Make browser_pdfjs_main.js correctly wait for the add-ons manager API callback.

r=ttaubert
This commit is contained in:
Marco Bonardo 2012-03-22 17:56:28 +01:00
parent 262609cd3f
commit 17e9213595

View File

@ -15,12 +15,16 @@ function test() {
registerCleanupFunction(function() {
aAddon.userDisabled = true;
});
});
continueTest();
});
}
function continueTest() {
var tab = gBrowser.addTab(TESTROOT + "file_pdfjs_test.pdf");
var newTabBrowser = gBrowser.getBrowserForTab(tab);
newTabBrowser.addEventListener("load", function () {
newTabBrowser.removeEventListener("load", arguments.callee, true);
newTabBrowser.addEventListener("load", function onLoad() {
newTabBrowser.removeEventListener("load", onLoad, true);
var hasViewer = newTabBrowser.contentDocument.querySelector('div#viewer');
var hasPDFJS = 'PDFJS' in newTabBrowser.contentWindow.wrappedJSObject;