1 // Load in the test harness
2 var scriptLoader
= Components
.classes
["@mozilla.org/moz/jssubscript-loader;1"]
3 .getService(Components
.interfaces
.mozIJSSubScriptLoader
);
6 var rootDir
= getRootDirectory(window
.location
.href
);
7 scriptLoader
.loadSubScript(rootDir
+ "harness.js", this);
9 // ----------------------------------------------------------------------------
10 // Test that an install that requires cookies to be sent fails when no cookies
12 // This verifies bug 462739
14 Harness
.installEndedCallback
= check_xpi_install
;
15 Harness
.installsCompletedCallback
= finish_test
;
18 var pm
= Services
.perms
;
19 pm
.add(makeURI("http://example.com/"), "install", pm
.ALLOW_ACTION
);
21 var triggers
= encodeURIComponent(JSON
.stringify({
22 "Cookie check": TESTROOT
+ "cookieRedirect.sjs?" + TESTROOT
+ "unsigned.xpi"
24 gBrowser
.selectedTab
= gBrowser
.addTab();
25 gBrowser
.loadURI(TESTROOT
+ "installtrigger.html?" + triggers
);
28 function check_xpi_install(addon
, status
) {
29 is(status
, -228, "Install should fail");
32 function finish_test() {
33 Services
.perms
.remove("example.com", "install");
35 gBrowser
.removeCurrentTab();