Merge mozilla-central to mozilla-inbound
authorEd Morley <bmo@edmorley.co.uk>
Tue, 10 Jan 2012 20:04:09 +0000
changeset 85371 8db1c4599e7b7fd87f31e38f00b26df499b20990
parent 85370 d377d38a23d3c2894df9ec0c6b6844a47def8024 (current diff)
parent 85324 011e3cef606891433ee68734561bc7e6fd9406f8 (diff)
child 85372 8eb5fd52246138ddf748a6c44e7fdbd44f5608fb
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.0a1
Merge mozilla-central to mozilla-inbound
--- a/toolkit/mozapps/downloads/tests/chrome/test_destinationURI_annotation.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_destinationURI_annotation.xul
@@ -29,16 +29,19 @@ const DOWNLOAD_URI = "http://mochi.test:
 const FILE_NAME = "unknownContentType_dialog_layout_data.pif";
 
 let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]
            .getService(Ci.nsIWindowWatcher);
 
 let dm = Cc["@mozilla.org/download-manager;1"]
            .getService(Ci.nsIDownloadManager);
 
+let os = Cc["@mozilla.org/observer-service;1"]
+           .getService(Ci.nsIObserverService);
+
 Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
 
 let checkDestination = false,
     checkFileName = false;
 
 SimpleTest.waitForExplicitFinish();
 
 let annoObserver = {
@@ -58,41 +61,55 @@ let annoObserver = {
        }
     }
   },
   onItemAnnotationSet: function() {},
   onPageAnnotationRemoved: function() {},
   onItemAnnotationRemoved: function() {}
 }
 
+let TestFinisher = {
+  _dmuiDone: false,
+  _callback: null,
+
+  observe: function(aSubject, aTopic, aData) {
+    os.removeObserver(TestFinisher, "download-manager-ui-done");
+
+    if (this._callback) {
+      SimpleTest.executeSoon(this._callback);
+      this._callback = null;
+    } else {
+      this._dmuiDone = true;
+    }
+  },
+
+  waitForDMUIDone: function(callback) {
+    if (this._dmuiDone) {
+      SimpleTest.executeSoon(callback);
+    } else {
+      this._callback = callback;
+    }
+  }
+};
+
+os.addObserver(TestFinisher, "download-manager-ui-done", false);
+
 let downloadListener = {
 
   onDownloadStateChange: function(aState, aDownload) {
     if (aDownload.state == Ci.nsIDownloadManager.DOWNLOAD_FINISHED) {
       is(aDownload.source.spec, DOWNLOAD_URI, "file was downloaded");
       dm.removeDownload(aDownload.id);
 
       try {
         aDownload.targetFile.remove(false);
       } catch (ex) {}
 
-      let os = Cc["@mozilla.org/observer-service;1"].
-               getService(Ci.nsIObserverService);
+      TestFinisher.waitForDMUIDone(endTest);
 
-      let testObs = {
-        observe: function(aSubject, aTopic, aData) {
-          if (aTopic != "download-manager-ui-done") {
-            return;
-          }
-          os.removeObserver(testObs, "download-manager-ui-done");
-          SimpleTest.executeSoon(endTest);
-        }
-      };
-
-      os.addObserver(testObs, "download-manager-ui-done", false);
     }
   },
 
   onStateChange: function() {},
   onProgressChange: function() {},
   onSecurityChange: function() {}
 };
 
@@ -112,37 +129,38 @@ let windowObserver = {
     }
 
     let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
 
     win.addEventListener("load", function onLoad(event) {
       win.removeEventListener("load", onLoad, false);
 
       if (win.location == UCT_URI) {
+        ww.unregisterNotification(windowObserver);
         SimpleTest.executeSoon(function() {
           win.document.documentElement._fireButtonEvent("accept");
           win.close();
           win = null;
         });
       }
     }, false);
   }
 };
 
 function endTest() {
   ok(checkDestination, "file destination was set");
   ok(checkFileName, "file name was set");
 
-  ww.unregisterNotification(windowObserver);
   PlacesUtils.annotations.removeObserver(annoObserver);
   dm.removeListener(downloadListener);
 
   ww = null;
   PlacesUtils = null;
   dm = null;
+  os = null;
 
   Cc["@mozilla.org/appshell/window-mediator;1"]
     .getService(Ci.nsIWindowMediator)
     .getMostRecentWindow("Download:Manager")
     .close();
 
   waitForClearHistory(SimpleTest.finish);
 }
--- a/toolkit/mozapps/installer/package-name.mk
+++ b/toolkit/mozapps/installer/package-name.mk
@@ -88,16 +88,17 @@ ifndef MOZ_PKG_APPNAME
 MOZ_PKG_APPNAME = $(MOZ_APP_NAME)
 endif
 
 PKG_BASENAME = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
 PKG_PATH =
 PKG_INST_BASENAME = $(PKG_BASENAME).installer
 PKG_INST_PATH = install/sea/
 PKG_UPDATE_BASENAME = $(PKG_BASENAME)
+CHECKSUMS_FILE_BASENAME = $(PKG_BASENAME)
 PKG_UPDATE_PATH = update/
 COMPLETE_MAR = $(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).complete.mar
 # PARTIAL_MAR needs to be processed by $(wildcard) before you use it.
 PARTIAL_MAR = $(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).partial.*.mar
 PKG_LANGPACK_BASENAME = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).langpack
 PKG_LANGPACK_PATH = $(MOZ_PKG_PLATFORM)/xpi/
 LANGPACK = $(PKG_LANGPACK_PATH)$(PKG_LANGPACK_BASENAME).xpi
 PKG_SRCPACK_BASENAME = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).source
@@ -129,16 +130,17 @@ endif
 endif
 PKG_PATH = $(MOZ_PKG_PLATFORM)/$(AB_CD)/
 ifeq ($(MOZ_APP_NAME),xulrunner)
 PKG_PATH = runtimes/
 PKG_BASENAME = $(MOZ_APP_NAME)-$(MOZ_PKG_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
 endif
 PKG_INST_PATH = $(PKG_PATH)
 PKG_UPDATE_BASENAME = $(MOZ_PKG_APPNAME_LC)-$(MOZ_PKG_VERSION)
+CHECKSUMS_FILE_BASENAME = $(MOZ_PKG_APPNAME_LC)-$(MOZ_PKG_VERSION)
 PKG_UPDATE_PATH = update/$(PKG_PATH)
 COMPLETE_MAR = $(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).complete.mar
 # PARTIAL_MAR needs to be processed by $(wildcard) before you use it.
 PARTIAL_MAR = $(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).partial.*.mar
 PKG_LANGPACK_BASENAME = $(AB_CD)
 PKG_LANGPACK_PATH = $(MOZ_PKG_PLATFORM)/xpi/
 LANGPACK = $(PKG_LANGPACK_PATH)$(PKG_LANGPACK_BASENAME).xpi
 PKG_SRCPACK_BASENAME = $(MOZ_PKG_APPNAME_LC)-$(MOZ_PKG_VERSION).source
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -896,17 +896,17 @@ space = $(empty) $(empty)
 QUOTED_WILDCARD = $(if $(wildcard $(subst $(space),?,$(1))),"$(1)")
 ESCAPE_SPACE = $(subst $(space),\$(space),$(1))
 
 # This variable defines which OpenSSL algorithm to use to 
 # generate checksums for files that we upload
 CHECKSUM_ALGORITHM = 'sha512'
 
 # This variable defines where the checksum file will be located
-CHECKSUM_FILE = "$(DIST)/$(PKG_PATH)/$(PKG_BASENAME).checksums"
+CHECKSUM_FILE = "$(DIST)/$(PKG_PATH)/$(CHECKSUMS_FILE_BASENAME).checksums"
 CHECKSUM_FILES = $(CHECKSUM_FILE)
 
 UPLOAD_FILES= \
   $(call QUOTED_WILDCARD,$(DIST)/$(PACKAGE)) \
   $(call QUOTED_WILDCARD,$(INSTALLER_PACKAGE)) \
   $(call QUOTED_WILDCARD,$(DIST)/$(COMPLETE_MAR)) \
   $(call QUOTED_WILDCARD,$(DIST)/$(LANGPACK)) \
   $(call QUOTED_WILDCARD,$(wildcard $(DIST)/$(PARTIAL_MAR))) \