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

Unified Diff: base/test/test_suite.cc

Issue 315403006: 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: trybots 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 ad5d9245bfe86ed11ee82fce7791582dbfc6f513..5777c5da879ece984adbbaf58540f02456c3aa10 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -90,12 +90,22 @@ int RunUnitTestsUsingBaseTestSuite(int argc, char **argv) {
} // namespace base
TestSuite::TestSuite(int argc, char** argv) : initialized_command_line_(false) {
- PreInitialize(argc, argv, true);
+ 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)
+
TestSuite::TestSuite(int argc, char** argv, bool create_at_exit_manager)
: initialized_command_line_(false) {
- PreInitialize(argc, argv, create_at_exit_manager);
+ PreInitialize(create_at_exit_manager);
+ InitializeFromCommandLine(argc, argv);
}
TestSuite::~TestSuite() {
@@ -103,16 +113,31 @@ TestSuite::~TestSuite() {
CommandLine::Reset();
}
-void TestSuite::PreInitialize(int argc, char** argv,
- bool create_at_exit_manager) {
+void TestSuite::InitializeFromCommandLine(int argc, char** argv) {
+ 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();
- initialized_command_line_ = CommandLine::Init(argc, argv);
- testing::InitGoogleTest(&argc, argv);
- testing::InitGoogleMock(&argc, argv);
#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
@@ -127,10 +152,6 @@ void TestSuite::PreInitialize(int argc, char** argv,
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
// Initialize(). See bug 6436.
}
« 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