Copy updater-xpcshell binary to test data directory
authorBrian R. Bondy <netzen@gmail.com>
Thu, 11 Dec 2014 22:49:09 -0500
changeset 491363 36f5fef1160057605fb20c061ebf4f969d974ed4
parent 491362 05fd8cf94ec6a61e6153381112b3c4461788add6
child 491364 e31f4dbce2229f7afff36a6dac03a1cca8f97623
push id47343
push userbmo:dothayer@mozilla.com
push dateWed, 01 Mar 2017 22:58:58 +0000
milestone36.0a1
Copy updater-xpcshell binary to test data directory
toolkit/mozapps/update/tests/unit_aus_update/head_update.js
toolkit/mozapps/update/updater/updater-xpcshell/Makefile.in
--- a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
@@ -98,17 +98,17 @@ const URL_HOST = "http://localhost";
 
 const FILE_APP_BIN = MOZ_APP_NAME + APP_BIN_SUFFIX;
 const FILE_COMPLETE_EXE = "complete.exe";
 const FILE_HELPER_BIN = "TestAUSHelper" + BIN_SUFFIX;
 const FILE_MAINTENANCE_SERVICE_BIN = "maintenanceservice.exe";
 const FILE_MAINTENANCE_SERVICE_INSTALLER_BIN = "maintenanceservice_installer.exe";
 const FILE_OLD_VERSION_MAR = "old_version.mar";
 const FILE_PARTIAL_EXE = "partial.exe";
-const FILE_UPDATER_BIN = "updater-xpcshell" + BIN_SUFFIX;
+const FILE_UPDATER_BIN = "updater" + BIN_SUFFIX;
 const FILE_WRONG_CHANNEL_MAR = "wrong_product_channel.mar";
 
 const LOG_SWITCH_SUCCESS = "rename_file: proceeding to rename the directory\n" +
                            "rename_file: proceeding to rename the directory\n" +
                            "Now, remove the tmpDir\n" +
                            "succeeded\n" +
                            "calling QuitProgressUI";
 
@@ -1472,33 +1472,33 @@ if (IS_WIN) {
  *          If null no function will be called when this function finishes.
  *          If not specified the checkUpdateApplied function will be called when
  *          this function finishes.
  */
 function runUpdate(aExpectedExitValue, aExpectedStatus, aCallback) {
   // Copy the updater binary to the updates directory.
   let binDir = gGREBinDirOrig.clone();
   let updater = binDir.clone();
-  updater.append("updater-xpcshell.app");
+  updater.append("updater.app");
   if (!updater.exists()) {
     updater = binDir.clone();
     updater.append(FILE_UPDATER_BIN);
     if (!updater.exists()) {
       do_throw("Unable to find updater binary!");
     }
   }
 
   let updatesDir = getUpdatesPatchDir();
   updater.copyToFollowingLinks(updatesDir, updater.leafName);
   let updateBin = updatesDir.clone();
   updateBin.append(updater.leafName);
-  if (updateBin.leafName == "updater-xpcshell.app") {
+  if (updateBin.leafName == "updater.app") {
     updateBin.append("Contents");
     updateBin.append("MacOS");
-    updateBin.append("updater-xpcshell");
+    updateBin.append("updater");
     if (!updateBin.exists()) {
       do_throw("Unable to find the updater executable!");
     }
   }
 
   let applyToDir = getApplyDirFile(null, true);
   let applyToDirPath = applyToDir.path;
 
--- a/toolkit/mozapps/update/updater/updater-xpcshell/Makefile.in
+++ b/toolkit/mozapps/update/updater/updater-xpcshell/Makefile.in
@@ -1,33 +1,46 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+XPCSHELLTESTROOT = $(abspath $(DEPTH))/_tests/xpcshell/$(relativesrcdir)
+
+ifndef MOZ_PROFILE_GENERATE
+ifdef COMPILE_ENVIRONMENT
+INSTALL_TARGETS              += xpcshell-updater
+xpcshell-updater_TARGET  := libs
+xpcshell-updater_DEST    := $(XPCSHELLTESTROOT)/data
+xpcshell-updater_FILES   := $(DIST)/bin/updater-xpcshell$(BIN_SUFFIX)
+endif
+endif # Not MOZ_PROFILE_GENERATE
+
+include $(topsrcdir)/config/rules.mk
+
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
 MOZ_WINCONSOLE = 0
 endif
 endif
 
-include $(topsrcdir)/config/rules.mk
-
 ifdef MOZ_WIDGET_GTK
 libs:: ../updater.png
 	$(NSINSTALL) -D $(DIST)/bin/icons
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/icons
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 libs::
-	$(NSINSTALL) -D $(DIST)/bin/updater-xpcshell.app
-	rsync -a -C --exclude '*.in' $(srcdir)/../macbuild/Contents $(DIST)/bin/updater-xpcshell.app
+	$(NSINSTALL) -D $(XPCSHELLTESTROOT)/data/updater-xpcshell.app
+	rsync -a -C --exclude '*.in' $(srcdir)/../macbuild/Contents $(XPCSHELLTESTROOT)/data/updater-xpcshell.app
 	sed -e 's/%APP_NAME%/$(MOZ_APP_DISPLAYNAME)/' $(srcdir)/../macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | \
-	  iconv -f UTF-8 -t UTF-16 > $(DIST)/bin/updater-xpcshell.app/Contents/Resources/English.lproj/InfoPlist.strings
-	$(NSINSTALL) -D $(DIST)/bin/updater-xpcshell.app/Contents/MacOS
-	$(NSINSTALL) $(DIST)/bin/updater-xpcshell $(DIST)/bin/updater-xpcshell.app/Contents/MacOS
-	rm -f $(DIST)/bin/updater-xpcshell
+	  iconv -f UTF-8 -t UTF-16 > $(XPCSHELLTESTROOT)/data/updater-xpcshell.app/Contents/Resources/English.lproj/InfoPlist.strings
+	$(NSINSTALL) -D $(XPCSHELLTESTROOT)/data/updater-xpcshell.app/Contents/MacOS/updater-xpcshell
+	$(NSINSTALL) $(XPCSHELLTESTROOT)/data/updater-xpcshell $(XPCSHELLTESTROOT)/data/updater-xpcshell.app/Contents/MacOS
+	rm -f $(XPCSHELLTESTROOT)/data/updater-xpcshell
+	mv $(XPCSHELLTESTROOT)/data/updater-xpcshell.app $(XPCSHELLTESTROOT)/data/updater.app
+	mv $(XPCSHELLTESTROOT)/data/updater.app/Contents/MacOS/updater-xpcshell $(XPCSHELLTESTROOT)/data/updater.app/Contents/MacOS/updater
 endif
 
 CXXFLAGS += $(MOZ_BZ2_CFLAGS)