|
1 // ---------------------------------------------------------------------------- |
|
2 // Tests installing an local file works when loading the url |
|
3 function test() { |
|
4 Harness.installEndedCallback = install_ended; |
|
5 Harness.installsCompletedCallback = finish_test; |
|
6 Harness.setup(); |
|
7 |
|
8 var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"] |
|
9 .getService(Components.interfaces.nsIChromeRegistry); |
|
10 |
|
11 var chromeroot = extractChromeRoot(gTestPath); |
|
12 try { |
|
13 var xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec; |
|
14 } catch (ex) { |
|
15 var xpipath = chromeroot + "unsigned.xpi"; //scenario where we are running from a .jar and already extracted |
|
16 } |
|
17 gBrowser.selectedTab = gBrowser.addTab(); |
|
18 gBrowser.loadURI(xpipath); |
|
19 } |
|
20 |
|
21 function install_ended(install, addon) { |
|
22 install.cancel(); |
|
23 } |
|
24 |
|
25 function finish_test(count) { |
|
26 is(count, 1, "1 Add-on should have been successfully installed"); |
|
27 |
|
28 gBrowser.removeCurrentTab(); |
|
29 Harness.finish(); |
|
30 } |
|
31 // ---------------------------------------------------------------------------- |