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