summaryrefslogtreecommitdiffstats
path: root/ipc/run_all_unittests.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 00:50:33 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 00:50:33 +0000
commit4cbafd3a738558dd71be58737ce3502595d43a7d (patch)
tree2c4fe0112b6e78682e7b02aa412e917d619974b9 /ipc/run_all_unittests.cc
parent2bd2c037fc6edbf605e1924de26b15b9a21729bc (diff)
downloadchromium_src-4cbafd3a738558dd71be58737ce3502595d43a7d.zip
chromium_src-4cbafd3a738558dd71be58737ce3502595d43a7d.tar.gz
chromium_src-4cbafd3a738558dd71be58737ce3502595d43a7d.tar.bz2
Run ipc_tests serially when using new test launcher.
On Windows they would hit resource contention issues otherwise and run slower than serially. Run time is in seconds anyway. BUG=236893 R=jeremy@chromium.org Review URL: https://codereview.chromium.org/93663002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/run_all_unittests.cc')
-rw-r--r--ipc/run_all_unittests.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/ipc/run_all_unittests.cc b/ipc/run_all_unittests.cc
new file mode 100644
index 0000000..d36f871
--- /dev/null
+++ b/ipc/run_all_unittests.cc
@@ -0,0 +1,40 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/at_exit.h"
+#include "base/bind.h"
+#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_suite.h"
+
+#if defined(OS_ANDROID)
+#include "base/android/jni_android.h"
+#include "base/test/test_file_util.h"
+#endif
+
+namespace {
+
+class NoAtExitBaseTestSuite : public base::TestSuite {
+ public:
+ NoAtExitBaseTestSuite(int argc, char** argv)
+ : base::TestSuite(argc, argv, false) {
+ }
+};
+
+int RunTestSuite(int argc, char** argv) {
+ return NoAtExitBaseTestSuite(argc, argv).Run();
+}
+
+} // namespace
+
+int main(int argc, char** argv) {
+#if defined(OS_ANDROID)
+ JNIEnv* env = base::android::AttachCurrentThread();
+ file_util::RegisterContentUriTestUtils(env);
+#else
+ base::AtExitManager at_exit;
+#endif
+ return base::LaunchUnitTestsSerially(argc,
+ argv,
+ base::Bind(&RunTestSuite, argc, argv));
+}