Backed out changeset b88172246b66 due to Win32 debug failures.
[mozilla-central.git] / xpinstall / tests / browser_whitelist6.js
blob1b5592ddbafc65088776744ec0e388156b41356c
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
12 function test() {
13   Harness.installBlockedCallback = allow_blocked;
14   Harness.installsCompletedCallback = finish_test;
15   Harness.setup();
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");
24   return false;
27 function finish_test() {
28   gBrowser.removeCurrentTab();
29   Harness.finish();
31 // ----------------------------------------------------------------------------