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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 UINT existing_flags = SetErrorMode(new_flags); | 168 UINT existing_flags = SetErrorMode(new_flags); |
169 SetErrorMode(existing_flags | new_flags); | 169 SetErrorMode(existing_flags | new_flags); |
170 #endif // defined(OS_WIN) | 170 #endif // defined(OS_WIN) |
171 } | 171 } |
172 | 172 |
173 void TestSuite::Initialize() { | 173 void TestSuite::Initialize() { |
174 // Initialize logging. | 174 // Initialize logging. |
175 FilePath exe; | 175 FilePath exe; |
176 PathService::Get(base::FILE_EXE, &exe); | 176 PathService::Get(base::FILE_EXE, &exe); |
177 FilePath log_filename = exe.ReplaceExtension(FILE_PATH_LITERAL("log")); | 177 FilePath log_filename = exe.ReplaceExtension(FILE_PATH_LITERAL("log")); |
178 logging::InitLogging( | 178 logging::InitLogging(log_filename.value().c_str(), |
179 log_filename.value().c_str(), | 179 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, |
180 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, | 180 logging::LOCK_LOG_FILE, |
181 logging::LOCK_LOG_FILE, | 181 logging::DELETE_OLD_LOG_FILE); |
182 logging::DELETE_OLD_LOG_FILE, | |
183 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | |
184 // We want process and thread IDs because we may have multiple processes. | 182 // We want process and thread IDs because we may have multiple processes. |
185 // Note: temporarily enabled timestamps in an effort to catch bug 6361. | 183 // Note: temporarily enabled timestamps in an effort to catch bug 6361. |
186 logging::SetLogItems(true, true, true, true); | 184 logging::SetLogItems(true, true, true, true); |
187 | 185 |
188 CHECK(base::EnableInProcessStackDumping()); | 186 CHECK(base::EnableInProcessStackDumping()); |
189 #if defined(OS_WIN) | 187 #if defined(OS_WIN) |
190 // Make sure we run with high resolution timer to minimize differences | 188 // Make sure we run with high resolution timer to minimize differences |
191 // between production code and test code. | 189 // between production code and test code. |
192 base::Time::EnableHighResolutionTimer(true); | 190 base::Time::EnableHighResolutionTimer(true); |
193 #endif // defined(OS_WIN) | 191 #endif // defined(OS_WIN) |
(...skipping 16 matching lines...) Expand all Loading... |
210 base::EnsureNSSInit(); | 208 base::EnsureNSSInit(); |
211 #endif // defined(USE_NSS) | 209 #endif // defined(USE_NSS) |
212 | 210 |
213 CatchMaybeTests(); | 211 CatchMaybeTests(); |
214 | 212 |
215 TestTimeouts::Initialize(); | 213 TestTimeouts::Initialize(); |
216 } | 214 } |
217 | 215 |
218 void TestSuite::Shutdown() { | 216 void TestSuite::Shutdown() { |
219 } | 217 } |
OLD | NEW |