OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling"; | 72 const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling"; |
73 | 73 |
74 TestSuite::TestSuite(int argc, char** argv) { | 74 TestSuite::TestSuite(int argc, char** argv) { |
75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
76 testing::GTEST_FLAG(catch_exceptions) = false; | 76 testing::GTEST_FLAG(catch_exceptions) = false; |
77 #endif | 77 #endif |
78 base::EnableTerminationOnHeapCorruption(); | 78 base::EnableTerminationOnHeapCorruption(); |
79 CommandLine::Init(argc, argv); | 79 CommandLine::Init(argc, argv); |
80 testing::InitGoogleTest(&argc, argv); | 80 testing::InitGoogleTest(&argc, argv); |
81 #if defined(OS_LINUX) && defined(USE_AURA) | 81 #if defined(OS_LINUX) && defined(USE_AURA) |
| 82 // When calling native char conversion functions (e.g wrctomb) we need to |
| 83 // have the locale set. In the absence of such a call the "C" locale is the |
| 84 // default. In the gtk code (below) gtk_init() implicitly sets a locale. |
82 setlocale(LC_ALL, ""); | 85 setlocale(LC_ALL, ""); |
83 #elif defined(TOOLKIT_USES_GTK) | 86 #elif defined(TOOLKIT_USES_GTK) |
84 gtk_init_check(&argc, &argv); | 87 gtk_init_check(&argc, &argv); |
85 #endif // defined(TOOLKIT_USES_GTK) | 88 #endif // defined(TOOLKIT_USES_GTK) |
86 // Don't add additional code to this constructor. Instead add it to | 89 // Don't add additional code to this constructor. Instead add it to |
87 // Initialize(). See bug 6436. | 90 // Initialize(). See bug 6436. |
88 } | 91 } |
89 | 92 |
90 TestSuite::~TestSuite() { | 93 TestSuite::~TestSuite() { |
91 CommandLine::Reset(); | 94 CommandLine::Reset(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 #endif | 260 #endif |
258 | 261 |
259 CatchMaybeTests(); | 262 CatchMaybeTests(); |
260 ResetCommandLine(); | 263 ResetCommandLine(); |
261 | 264 |
262 TestTimeouts::Initialize(); | 265 TestTimeouts::Initialize(); |
263 } | 266 } |
264 | 267 |
265 void TestSuite::Shutdown() { | 268 void TestSuite::Shutdown() { |
266 } | 269 } |
OLD | NEW |