1 // Load in the test harness
2 var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
3 .getService(Components.interfaces.mozIJSSubScriptLoader);
4 scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
6 // ----------------------------------------------------------------------------
7 // Tests installing an local file works when loading the url
9 Harness.installEndedCallback = check_xpi_install;
10 Harness.installsCompletedCallback = finish_test;
13 var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
14 .getService(Components.interfaces.nsIChromeRegistry);
15 var path = cr.convertChromeURL(makeURI(CHROMEROOT + "unsigned.xpi")).spec;
17 gBrowser.selectedTab = gBrowser.addTab();
18 gBrowser.loadURI(path);
21 function check_xpi_install(addon, status) {
22 is(status, 0, "Install should succeed");
25 function finish_test() {
26 var em = Components.classes["@mozilla.org/extensions/manager;1"]
27 .getService(Components.interfaces.nsIExtensionManager);
28 em.cancelInstallItem("unsigned-xpi@tests.mozilla.org");
30 gBrowser.removeCurrentTab();
33 // ----------------------------------------------------------------------------