Backout 84ce41f8cec7 due to leak.
authorBlair McBride <bmcbride@mozilla.com>
Thu, 11 Aug 2011 18:04:02 +1200
changeset 74203 aa9f527a4928ed675a09eb28d30b0ed63a857575
parent 74202 be17ceae8d600dabc4eadc7c84c53d9dfe031bdf
child 74204 7871abb0e291ea276fc701bcd7cd22854c83b63e
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone8.0a1
backs out84ce41f8cec7abf76d97d9c6822da1e1dd83bbf2
Backout 84ce41f8cec7 due to leak.
toolkit/mozapps/extensions/amWebInstallListener.js
toolkit/mozapps/extensions/test/xpinstall/Makefile.in
toolkit/mozapps/extensions/test/xpinstall/browser_bug672485.js
--- a/toolkit/mozapps/extensions/amWebInstallListener.js
+++ b/toolkit/mozapps/extensions/amWebInstallListener.js
@@ -49,18 +49,16 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
-const URI_XPINSTALL_DIALOG = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
-
 // Installation can begin from any of these states
 const READY_STATES = [
   AddonManager.STATE_AVAILABLE,
   AddonManager.STATE_DOWNLOAD_FAILED,
   AddonManager.STATE_INSTALL_FAILED,
   AddonManager.STATE_CANCELLED
 ];
 
@@ -201,23 +199,18 @@ Installer.prototype = {
       catch (e) {}
     }
 
     let args = {};
     args.url = this.url;
     args.installs = this.downloads;
     args.wrappedJSObject = args;
 
-    try {
-      Services.ww.openWindow(this.window, URI_XPINSTALL_DIALOG,
-                             null, "chrome,modal,centerscreen", args);
-    } catch (e) {
-      this.downloads.forEach(function(aInstall) aInstall.cancel());
-      notifyObservers("addon-install-failed", this.window, this.url, failed);
-    }
+    Services.ww.openWindow(this.window, "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul",
+                           null, "chrome,modal,centerscreen", args);
   },
 
   /**
    * Checks if all installs are now complete and if so notifies observers.
    */
   checkAllInstalled: function() {
     var failed = [];
 
--- a/toolkit/mozapps/extensions/test/xpinstall/Makefile.in
+++ b/toolkit/mozapps/extensions/test/xpinstall/Makefile.in
@@ -93,17 +93,16 @@ include $(topsrcdir)/config/rules.mk
                  browser_httphash4.js \
                  browser_httphash5.js \
                  browser_httphash6.js \
                  browser_badargs.js \
                  browser_badargs2.js \
                  browser_bug611242.js \
                  browser_bug638292.js \
                  browser_bug645699.js \
-                 browser_bug672485.js \
                  unsigned.xpi \
                  signed.xpi \
                  signed2.xpi \
                  signed-no-o.xpi \
                  signed-no-cn.xpi \
                  signed-untrusted.xpi \
                  signed-tampered.xpi \
                  theme.xpi \
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_bug672485.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function test() {
-  Harness.installConfirmCallback = confirm_install;
-  Harness.installFailedCallback = failed_install;
-  Harness.installEndedCallback = complete_install;
-  Harness.installsCompletedCallback = finish_test;
-  Harness.setup();
-  
-  delete Services.ww;
-  is(Services.ww, undefined, "Services.ww should now be undefined");
-
-  var pm = Services.perms;
-  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
-
-  var triggers = encodeURIComponent(JSON.stringify({
-    "Unsigned XPI": TESTROOT + "unsigned.xpi"
-  }));
-  gBrowser.selectedTab = gBrowser.addTab();
-  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-}
-
-function confirm_install(window) {
-  ok(false, "Should not see the install dialog");
-  return false;
-}
-
-function failed_install() {
-  ok(true, "Install should fail");
-}
-
-function complete_install() {
-  ok(false, "Install should not have completed");
-  return false;
-}
-
-function finish_test(count) {
-  is(count, 0, "0 Add-ons should have been successfully installed");
-
-  gBrowser.removeCurrentTab();
-  
-  Services.ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]
-                  .getService(Ci.nsIWindowWatcher);
-  
-  Harness.finish();
-}