|
1 // ---------------------------------------------------------------------------- |
|
2 // Tests installing an unsigned add-on through a startSoftwareUpdate call in web |
|
3 // content. This should be blocked by the whitelist check. |
|
4 // This verifies bug 252830 |
|
5 function test() { |
|
6 Harness.installBlockedCallback = allow_blocked; |
|
7 Harness.installsCompletedCallback = finish_test; |
|
8 Harness.setup(); |
|
9 |
|
10 gBrowser.selectedTab = gBrowser.addTab(); |
|
11 gBrowser.loadURI(TESTROOT + "startsoftwareupdate.html? " + encodeURIComponent(TESTROOT + "unsigned.xpi")); |
|
12 } |
|
13 |
|
14 function allow_blocked(installInfo) { |
|
15 is(installInfo.originatingWindow, gBrowser.contentWindow, "Install should have been triggered by the right window"); |
|
16 is(installInfo.originatingURI.spec, gBrowser.currentURI.spec, "Install should have been triggered by the right uri"); |
|
17 return false; |
|
18 } |
|
19 |
|
20 function finish_test(count) { |
|
21 is(count, 0, "No add-ons should have been installed"); |
|
22 gBrowser.removeCurrentTab(); |
|
23 Harness.finish(); |
|
24 } |
|
25 // ---------------------------------------------------------------------------- |