|
1 // ---------------------------------------------------------------------------- |
|
2 // Tests that calling InstallTrigger.installChrome works |
|
3 function test() { |
|
4 Harness.installEndedCallback = check_xpi_install; |
|
5 Harness.installsCompletedCallback = finish_test; |
|
6 Harness.setup(); |
|
7 |
|
8 var pm = Services.perms; |
|
9 pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION); |
|
10 |
|
11 gBrowser.selectedTab = gBrowser.addTab(); |
|
12 gBrowser.loadURI(TESTROOT + "bug540558.html"); |
|
13 } |
|
14 |
|
15 function check_xpi_install(install, addon) { |
|
16 install.cancel(); |
|
17 } |
|
18 |
|
19 function finish_test(count) { |
|
20 is(count, 1, "1 Add-on should have been successfully installed"); |
|
21 Services.perms.remove("example.com", "install"); |
|
22 |
|
23 gBrowser.removeCurrentTab(); |
|
24 Harness.finish(); |
|
25 } |