import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,32 @@
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through a direct install request from
// web content. This should be blocked by the whitelist check because we disable
// direct request whitelisting, even though the target URI is whitelisted.
function test() {
Harness.installBlockedCallback = allow_blocked;
Harness.installsCompletedCallback = finish_test;
Harness.setup();
// Disable direct request whitelisting, installing should be blocked.
Services.prefs.setBoolPref("xpinstall.whitelist.directRequest", false);
gBrowser.selectedTab = gBrowser.addTab("about:blank");
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
gBrowser.loadURI(TESTROOT + "amosigned.xpi");
});
}
function allow_blocked(installInfo) {
ok(true, "Seen blocked");
return false;
}
function finish_test(count) {
is(count, 0, "No add-ons should have been installed");
Services.perms.remove(makeURI("http://example.org"), "install");
Services.prefs.clearUserPref("xpinstall.whitelist.directRequest");
gBrowser.removeCurrentTab();
Harness.finish();
}