1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 add_task(async function test_pdfjs_not_default() {
5 var oldAction = changeMimeHandler(Ci.nsIHandlerInfo.useSystemDefault, true);
6 let dirFileObj = getChromeDir(getResolvedURI(gTestPath));
7 dirFileObj.append("file_pdfjs_test.pdf");
9 let tab = await BrowserTestUtils.openNewForegroundTab(
14 // If we don't have the Pdfjs actor loaded, this will throw
15 await getPdfjsActor();
17 changeMimeHandler(oldAction[0], oldAction[1]);
19 await waitForPdfJSClose(tab.linkedBrowser, /* closeTab = */ true);
22 function getPdfjsActor() {
23 let win = Services.wm.getMostRecentWindow("navigator:browser");
24 let selectedBrowser = win.gBrowser.selectedBrowser;
25 return selectedBrowser.browsingContext.currentWindowGlobal.getActor("Pdfjs");