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