Fix some test failures on linux
authorBrian R. Bondy <netzen@gmail.com>
Tue, 16 Dec 2014 23:45:18 -0500
changeset 491365 43be9c3acdb36b44be04924ef52e0f03df975690
parent 491364 e31f4dbce2229f7afff36a6dac03a1cca8f97623
child 491366 07a508ef6ecc4bf86609d941d19617f58e5dad15
push id47343
push userbmo:dothayer@mozilla.com
push dateWed, 01 Mar 2017 22:58:58 +0000
milestone36.0a1
Fix some test failures on linux
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
@@ -1248,19 +1248,19 @@ function getTestDirPath() {
  *
  * @param   aRelPath (optional)
  *          The relative path to the file or directory to get from the root of
  *          the test's data directory. If not specified the test's data
  *          directory will be returned.
  * @return  The nsIFile for the file in the test data directory.
  * @throws  If the file or directory does not exist.
  */
-function getTestDirFile(aRelPath) {
+function getTestDirFile(aRelPath, allowNonExists) {
   let relpath = getTestDirPath() + (aRelPath ? aRelPath : "");
-  return do_get_file(relpath, false);
+  return do_get_file(relpath, !!allowNonExists);
 }
 
 #ifdef XP_WIN
 function getSpecialFolderDir(aCSIDL) {
   AUS_Cu.import("resource://gre/modules/ctypes.jsm");
   let lib = ctypes.open("shell32");
   let SHGetSpecialFolderPath = lib.declare("SHGetSpecialFolderPathW",
                                            ctypes.winapi_abi,
@@ -1471,17 +1471,17 @@ if (IS_WIN) {
  *          A callback function that will be called when this function finishes.
  *          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 = getTestDirFile("updater.app");
+  let updater = getTestDirFile("updater.app", true);
   if (!updater.exists()) {
     updater = getTestDirFile(FILE_UPDATER_BIN);
     if (!updater.exists()) {
       do_throw("Unable to find updater binary!");
     }
   }
 
   let updatesDir = getUpdatesPatchDir();
@@ -1782,17 +1782,17 @@ function setupAppFiles() {
     // We use the updater binary after this loop from the data dir instead
     // because it has the xpcshell certs.
     if (aAppFile.relPath !== FILE_UPDATER_BIN) {
         copyFileToTestAppDir(aAppFile.relPath, aAppFile.inGreDir);
     }
   });
 
   // Copy the xpcshell updater binary
-  let updater = getTestDirFile("updater.app");
+  let updater = getTestDirFile("updater.app", true);
   if (!updater.exists()) {
     updater = getTestDirFile(FILE_UPDATER_BIN);
     if (!updater.exists()) {
       do_throw("Unable to find updater binary!");
     }
   }
   let outputBinDir = getGREBinDir()
   updater.copyToFollowingLinks(outputBinDir, updater.leafName);
--- a/toolkit/mozapps/update/updater/updater-xpcshell/Makefile.in
+++ b/toolkit/mozapps/update/updater/updater-xpcshell/Makefile.in
@@ -36,11 +36,13 @@ libs::
 	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 > $(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
+else
+	mv $(XPCSHELLTESTROOT)/data/updater-xpcshell $(XPCSHELLTESTROOT)/data/updater
 endif
 
 CXXFLAGS += $(MOZ_BZ2_CFLAGS)