| 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
|
|
|