Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1361)

Unified Diff: base/test/test_suite.cc

Issue 314173005: Revert of Convert installer_util_unittests, sbox_integration_tests, sbox_validation_tests, sbox_unittests to … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/test_suite.h ('k') | chrome/installer/util/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_suite.cc
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index 5777c5da879ece984adbbaf58540f02456c3aa10..ad5d9245bfe86ed11ee82fce7791582dbfc6f513 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -90,22 +90,12 @@
} // namespace base
TestSuite::TestSuite(int argc, char** argv) : initialized_command_line_(false) {
- PreInitialize(true);
- InitializeFromCommandLine(argc, argv);
-}
-
-#if defined(OS_WIN)
-TestSuite::TestSuite(int argc, wchar_t** argv)
- : initialized_command_line_(false) {
- PreInitialize(true);
- InitializeFromCommandLine(argc, argv);
-}
-#endif // defined(OS_WIN)
+ PreInitialize(argc, argv, true);
+}
TestSuite::TestSuite(int argc, char** argv, bool create_at_exit_manager)
: initialized_command_line_(false) {
- PreInitialize(create_at_exit_manager);
- InitializeFromCommandLine(argc, argv);
+ PreInitialize(argc, argv, create_at_exit_manager);
}
TestSuite::~TestSuite() {
@@ -113,31 +103,16 @@
CommandLine::Reset();
}
-void TestSuite::InitializeFromCommandLine(int argc, char** argv) {
+void TestSuite::PreInitialize(int argc, char** argv,
+ bool create_at_exit_manager) {
+#if defined(OS_WIN)
+ testing::GTEST_FLAG(catch_exceptions) = false;
+ base::TimeTicks::SetNowIsHighResNowIfSupported();
+#endif
+ base::EnableTerminationOnHeapCorruption();
initialized_command_line_ = CommandLine::Init(argc, argv);
testing::InitGoogleTest(&argc, argv);
testing::InitGoogleMock(&argc, argv);
-
-#if defined(OS_IOS)
- InitIOSRunHook(this, argc, argv);
-#endif
-}
-
-#if defined(OS_WIN)
-void TestSuite::InitializeFromCommandLine(int argc, wchar_t** argv) {
- // Windows CommandLine::Init ignores argv anyway.
- initialized_command_line_ = CommandLine::Init(argc, NULL);
- testing::InitGoogleTest(&argc, argv);
- testing::InitGoogleMock(&argc, argv);
-}
-#endif // defined(OS_WIN)
-
-void TestSuite::PreInitialize(bool create_at_exit_manager) {
-#if defined(OS_WIN)
- testing::GTEST_FLAG(catch_exceptions) = false;
- base::TimeTicks::SetNowIsHighResNowIfSupported();
-#endif
- base::EnableTerminationOnHeapCorruption();
#if defined(OS_LINUX) && defined(USE_AURA)
// When calling native char conversion functions (e.g wrctomb) we need to
// have the locale set. In the absence of such a call the "C" locale is the
@@ -150,6 +125,10 @@
#if !defined(OS_ANDROID)
if (create_at_exit_manager)
at_exit_manager_.reset(new base::AtExitManager);
+#endif
+
+#if defined(OS_IOS)
+ InitIOSRunHook(this, argc, argv);
#endif
// Don't add additional code to this function. Instead add it to
« no previous file with comments | « base/test/test_suite.h ('k') | chrome/installer/util/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698