|
1 // ---------------------------------------------------------------------------- |
|
2 // Tests installing an unsigned add-on through a navigation. Should not be |
|
3 // blocked since the referer is whitelisted. |
|
4 function test() { |
|
5 Harness.installConfirmCallback = confirm_install; |
|
6 Harness.installsCompletedCallback = finish_test; |
|
7 Harness.setup(); |
|
8 |
|
9 var pm = Services.perms; |
|
10 pm.add(makeURI("http://example.org/"), "install", pm.ALLOW_ACTION); |
|
11 |
|
12 var triggers = encodeURIComponent(JSON.stringify({ |
|
13 "Unsigned XPI": TESTROOT2 + "unsigned.xpi" |
|
14 })); |
|
15 gBrowser.selectedTab = gBrowser.addTab(); |
|
16 gBrowser.loadURI(TESTROOT + "unsigned.xpi", makeURI(TESTROOT2 + "test.html")); |
|
17 } |
|
18 |
|
19 function confirm_install(window) { |
|
20 return false; |
|
21 } |
|
22 |
|
23 function finish_test(count) { |
|
24 is(count, 0, "No add-ons should have been installed"); |
|
25 Services.perms.remove("example.org", "install"); |
|
26 |
|
27 gBrowser.removeCurrentTab(); |
|
28 Harness.finish(); |
|
29 } |