Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // ----------------------------------------------------------------------------
2 // Test that an install that requires cookies to be sent fails when no cookies
3 // are set
4 // This verifies bug 462739
5 function test() {
6 Harness.downloadFailedCallback = download_failed;
7 Harness.installsCompletedCallback = finish_test;
8 Harness.setup();
10 var pm = Services.perms;
11 pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
13 var triggers = encodeURIComponent(JSON.stringify({
14 "Cookie check": TESTROOT + "cookieRedirect.sjs?" + TESTROOT + "unsigned.xpi"
15 }));
16 gBrowser.selectedTab = gBrowser.addTab();
17 gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
18 }
20 function download_failed(install) {
21 is(install.error, AddonManager.ERROR_NETWORK_FAILURE, "Install should fail");
22 }
24 function finish_test(count) {
25 is(count, 0, "No add-ons should have been installed");
26 Services.perms.remove("example.com", "install");
28 gBrowser.removeCurrentTab();
29 Harness.finish();
30 }