1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist6.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +// ---------------------------------------------------------------------------- 1.5 +// Tests installing an unsigned add-on through an installChrome call in web 1.6 +// content. This should be blocked by the whitelist check. 1.7 +// This verifies bug 252830 1.8 +function test() { 1.9 + Harness.installBlockedCallback = allow_blocked; 1.10 + Harness.installsCompletedCallback = finish_test; 1.11 + Harness.setup(); 1.12 + 1.13 + gBrowser.selectedTab = gBrowser.addTab(); 1.14 + gBrowser.loadURI(TESTROOT + "installchrome.html? " + encodeURIComponent(TESTROOT + "unsigned.xpi")); 1.15 +} 1.16 + 1.17 +function allow_blocked(installInfo) { 1.18 + is(installInfo.originatingWindow, gBrowser.contentWindow, "Install should have been triggered by the right window"); 1.19 + is(installInfo.originatingURI.spec, gBrowser.currentURI.spec, "Install should have been triggered by the right uri"); 1.20 + return false; 1.21 +} 1.22 + 1.23 +function finish_test(count) { 1.24 + is(count, 0, "No add-ons should have been installed"); 1.25 + gBrowser.removeCurrentTab(); 1.26 + Harness.finish(); 1.27 +} 1.28 +// ----------------------------------------------------------------------------