summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/webextensions/browser_permissions_mozAddonManager.js
blob: 1370ff18f7917879b27a3d1eeab6c02e4aea188d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use strict";

const INSTALL_PAGE = `${BASE}/file_install_extensions.html`;

async function installMozAM(filename) {
  BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, INSTALL_PAGE);
  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);

  await SpecialPowers.spawn(
    gBrowser.selectedBrowser,
    [`${BASE}/${filename}`],
    async function (url) {
      await content.wrappedJSObject.installMozAM(url);
    }
  );
}

add_task(() => testInstallMethod(installMozAM, "installAmo"));