1 // Load in the test harness
2 var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
3 .getService(Components.interfaces.mozIJSSubScriptLoader);
5 var rootDir = getRootDirectory(window.location.href);
6 scriptLoader.loadSubScript(rootDir + "harness.js", this);
8 // ----------------------------------------------------------------------------
9 // Tests installing an unsigned add-on through an installChrome call in web
10 // content. This should be blocked by the whitelist check.
11 // This verifies bug 252830
13 Harness.installBlockedCallback = allow_blocked;
14 Harness.installsCompletedCallback = finish_test;
17 gBrowser.selectedTab = gBrowser.addTab();
18 gBrowser.loadURI(TESTROOT + "installchrome.html? " + encodeURIComponent(TESTROOT + "unsigned.xpi"));
21 function allow_blocked(installInfo) {
22 is(installInfo.originatingWindow, gBrowser.contentWindow, "Install should have been triggered by the right window");
23 is(installInfo.originatingURI.spec, gBrowser.currentURI.spec, "Install should have been triggered by the right uri");
27 function finish_test() {
28 gBrowser.removeCurrentTab();
31 // ----------------------------------------------------------------------------