Bug 574778 - Fix win widget's ConstrainPosition so that it supports full screen windo...
[mozilla-central.git] / xpinstall / tests / browser_localfile.js
blobd7910b0dd82ff35bfe77f7e5698a2fa7987aa96b
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
8 function test() {
9   Harness.installEndedCallback = check_xpi_install;
10   Harness.installsCompletedCallback = finish_test;
11   Harness.setup();
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();
31   Harness.finish();
33 // ----------------------------------------------------------------------------