Bug 1340699 - Move TestAUSReadStrings into ausReadStrings.js; r=rstrong,ted
authorMike Shal <mshal@mozilla.com>
Fri, 03 Mar 2017 10:59:51 -0500
changeset 374927 b905df59d733fee22cbe9f05a4071be3f00e149d
parent 374926 2a8e33a5f238deb6d06871f4f2f4d9b83cd70d13
child 374928 e393e6c239cd79fbef63a72ff9e15f1a989c80ae
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong, ted
bugs1340699
milestone54.0a1
Bug 1340699 - Move TestAUSReadStrings into ausReadStrings.js; r=rstrong,ted This pulls the test out of 'make check' and runs it as part of xpcshell instead. MozReview-Commit-ID: 7DJAvrG7Tq1
toolkit/mozapps/update/tests/Makefile.in
toolkit/mozapps/update/tests/moz.build
toolkit/mozapps/update/tests/unit_aus_update/ausReadStrings.js
toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
--- a/toolkit/mozapps/update/tests/Makefile.in
+++ b/toolkit/mozapps/update/tests/Makefile.in
@@ -7,33 +7,11 @@ XPCSHELLTESTROOT = $(topobjdir)/_tests/x
 pp_const_file = $(srcdir)/data/xpcshellConstantsPP.js
 
 PP_TARGETS            += aus-test-const
 aus-test-const        := $(pp_const_file)
 aus-test-const_PATH   := $(XPCSHELLTESTROOT)/data
 aus-test-const_FLAGS  := -Fsubstitution $(DEFINES) $(ACDEFINES)
 aus-test-const_TARGET := misc
 
-INI_TEST_FILES = \
-  TestAUSReadStrings1.ini \
-  TestAUSReadStrings2.ini \
-  TestAUSReadStrings3.ini \
-  $(NULL)
-
 MOZ_WINCONSOLE = 1
 
 include $(topsrcdir)/config/rules.mk
-
-# TestAUSReadStrings runs during check in the following directory with a Unicode
-# char in order to test bug 473417 on Windows.
-ifeq ($(OS_ARCH),WINNT)
-bug473417dir = test_bug473417-๓
-else
-bug473417dir = test_bug473417
-endif
-
-check::
-	$(RM) -rf $(DEPTH)/_tests/updater/ && $(NSINSTALL) -D $(DEPTH)/_tests/updater/$(bug473417dir)/
-	for i in $(INI_TEST_FILES); do \
-	  $(INSTALL) $(srcdir)/$$i $(DEPTH)/_tests/updater/$(bug473417dir)/; \
-	done
-	$(INSTALL) $(FINAL_TARGET)/TestAUSReadStrings$(BIN_SUFFIX) $(DEPTH)/_tests/updater/$(bug473417dir)/
-	@$(RUN_TEST_PROGRAM) $(DEPTH)/_tests/updater/$(bug473417dir)/TestAUSReadStrings$(BIN_SUFFIX)
--- a/toolkit/mozapps/update/tests/moz.build
+++ b/toolkit/mozapps/update/tests/moz.build
@@ -98,9 +98,12 @@ FINAL_TARGET_FILES += [
     'data/partial_removed-files_mac',
     'data/partial_update_manifest',
     'data/replace_log_success',
     'data/shared.js',
     'data/sharedUpdateXML.js',
     'data/simple.mar',
     'data/wrong_product_channel.mar',
     'data/xpcshellUtilsAUS.js',
+    'TestAUSReadStrings1.ini',
+    'TestAUSReadStrings2.ini',
+    'TestAUSReadStrings3.ini',
 ]
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_aus_update/ausReadStrings.js
@@ -0,0 +1,31 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+const BIN_DIR = (IS_WIN ? "test_bug473417-รณ" : "test_bug473417")
+const BIN_EXE = "TestAUSReadStrings" + BIN_SUFFIX;
+const tempdir = do_get_tempdir();
+
+function run_test() {
+  let workdir = tempdir.clone();
+  workdir.append(BIN_DIR);
+
+  let paths = [
+    BIN_EXE,
+    "TestAUSReadStrings1.ini",
+    "TestAUSReadStrings2.ini",
+    "TestAUSReadStrings3.ini",
+  ];
+  for (let i = 0; i < paths.length; i++) {
+    let file = do_get_file("../data/" + paths[i]);
+    file.copyTo(workdir, null)
+  }
+
+  let readStrings = workdir.clone();
+  readStrings.append(BIN_EXE);
+
+  let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
+  process.init(readStrings);
+  process.run(true, [], 0);
+  do_check_eq(process.exitValue, 0);
+}
--- a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
@@ -1,16 +1,17 @@
 # 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/.
 
 [DEFAULT]
 tags = appupdate
 head = head_update.js
 
+[ausReadStrings.js]
 [canCheckForAndCanApplyUpdates.js]
 [urlConstruction.js]
 [updateManagerXML.js]
 [remoteUpdateXML.js]
 [downloadAndHashCheckMar.js]
 [cleanupDownloadingForOlderAppVersion.js]
 [cleanupDownloadingForDifferentChannel.js]
 [cleanupDownloadingForSameVersionAndBuildID.js]