| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/test/test_suite.h" | 5 #include "base/test/test_suite.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 TestSuite::~TestSuite() { | 93 TestSuite::~TestSuite() { |
| 94 if (initialized_command_line_) | 94 if (initialized_command_line_) |
| 95 CommandLine::Reset(); | 95 CommandLine::Reset(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void TestSuite::PreInitialize(int argc, char** argv, | 98 void TestSuite::PreInitialize(int argc, char** argv, |
| 99 bool create_at_exit_manager) { | 99 bool create_at_exit_manager) { |
| 100 #if defined(OS_WIN) | 100 #if defined(OS_WIN) |
| 101 testing::GTEST_FLAG(catch_exceptions) = false; | 101 testing::GTEST_FLAG(catch_exceptions) = false; |
| 102 base::TimeTicks::SetNowIsHighResNowIfSupported(); |
| 102 #endif | 103 #endif |
| 103 base::EnableTerminationOnHeapCorruption(); | 104 base::EnableTerminationOnHeapCorruption(); |
| 104 initialized_command_line_ = CommandLine::Init(argc, argv); | 105 initialized_command_line_ = CommandLine::Init(argc, argv); |
| 105 testing::InitGoogleTest(&argc, argv); | 106 testing::InitGoogleTest(&argc, argv); |
| 106 #if defined(OS_LINUX) && defined(USE_AURA) | 107 #if defined(OS_LINUX) && defined(USE_AURA) |
| 107 // When calling native char conversion functions (e.g wrctomb) we need to | 108 // When calling native char conversion functions (e.g wrctomb) we need to |
| 108 // have the locale set. In the absence of such a call the "C" locale is the | 109 // have the locale set. In the absence of such a call the "C" locale is the |
| 109 // default. In the gtk code (below) gtk_init() implicitly sets a locale. | 110 // default. In the gtk code (below) gtk_init() implicitly sets a locale. |
| 110 setlocale(LC_ALL, ""); | 111 setlocale(LC_ALL, ""); |
| 111 #elif defined(TOOLKIT_GTK) | 112 #elif defined(TOOLKIT_GTK) |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 ResetCommandLine(); | 284 ResetCommandLine(); |
| 284 #if !defined(OS_IOS) | 285 #if !defined(OS_IOS) |
| 285 AddTestLauncherResultPrinter(); | 286 AddTestLauncherResultPrinter(); |
| 286 #endif // !defined(OS_IOS) | 287 #endif // !defined(OS_IOS) |
| 287 | 288 |
| 288 TestTimeouts::Initialize(); | 289 TestTimeouts::Initialize(); |
| 289 } | 290 } |
| 290 | 291 |
| 291 void TestSuite::Shutdown() { | 292 void TestSuite::Shutdown() { |
| 292 } | 293 } |
| OLD | NEW |