michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: gWindowWatcher = null; michael@0: michael@0: function test() { michael@0: Harness.installConfirmCallback = confirm_install; michael@0: Harness.installCancelledCallback = cancelled_install; michael@0: Harness.installEndedCallback = complete_install; michael@0: Harness.installsCompletedCallback = finish_test; michael@0: Harness.setup(); michael@0: michael@0: gWindowWatcher = Services.ww; michael@0: delete Services.ww; michael@0: is(Services.ww, undefined, "Services.ww should now be undefined"); 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: "Unsigned XPI": 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 confirm_install(window) { michael@0: ok(false, "Should not see the install dialog"); michael@0: return false; michael@0: } michael@0: michael@0: function cancelled_install() { michael@0: ok(true, "Install should b cancelled"); michael@0: } michael@0: michael@0: function complete_install() { michael@0: ok(false, "Install should not have completed"); michael@0: return false; michael@0: } michael@0: michael@0: function finish_test(count) { michael@0: is(count, 0, "0 Add-ons should have been successfully installed"); michael@0: michael@0: gBrowser.removeCurrentTab(); michael@0: michael@0: Services.ww = gWindowWatcher; michael@0: michael@0: Services.perms.remove("example.com", "install"); michael@0: michael@0: Harness.finish(); michael@0: }