michael@0: // ---------------------------------------------------------------------------- michael@0: // Test that an install that requires cookies to be sent fails when no cookies michael@0: // are set michael@0: // This verifies bug 462739 michael@0: function test() { michael@0: Harness.downloadFailedCallback = download_failed; 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.com/"), "install", pm.ALLOW_ACTION); michael@0: michael@0: var triggers = encodeURIComponent(JSON.stringify({ michael@0: "Cookie check": TESTROOT + "cookieRedirect.sjs?" + TESTROOT + "unsigned.xpi" michael@0: })); michael@0: gBrowser.selectedTab = gBrowser.addTab(); michael@0: gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers); michael@0: } michael@0: michael@0: function download_failed(install) { michael@0: is(install.error, AddonManager.ERROR_NETWORK_FAILURE, "Install should fail"); 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.com", "install"); michael@0: michael@0: gBrowser.removeCurrentTab(); michael@0: Harness.finish(); michael@0: }