michael@0: // ---------------------------------------------------------------------------- michael@0: // Tests installing an unsigned add-on through a navigation. Should not be michael@0: // blocked since the referer is whitelisted. michael@0: function test() { michael@0: Harness.installConfirmCallback = confirm_install; michael@0: Harness.installsCompletedCallback = finish_test; michael@0: Harness.setup(); michael@0: michael@0: var pm = Services.perms; michael@0: pm.add(makeURI("http://example.org/"), "install", pm.ALLOW_ACTION); michael@0: michael@0: var triggers = encodeURIComponent(JSON.stringify({ michael@0: "Unsigned XPI": TESTROOT2 + "unsigned.xpi" michael@0: })); michael@0: gBrowser.selectedTab = gBrowser.addTab(); michael@0: gBrowser.loadURI(TESTROOT + "unsigned.xpi", makeURI(TESTROOT2 + "test.html")); michael@0: } michael@0: michael@0: function confirm_install(window) { 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: Services.perms.remove("example.org", "install"); michael@0: michael@0: gBrowser.removeCurrentTab(); michael@0: Harness.finish(); michael@0: }