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" |
11 #include "base/debug_on_start.h" | 11 #include "base/debug_on_start.h" |
12 #include "base/debug_util.h" | |
13 #include "base/debug/debugger.h" | |
14 #include "base/debug/debugger.h" | 12 #include "base/debug/debugger.h" |
15 #include "base/file_path.h" | 13 #include "base/file_path.h" |
16 #include "base/i18n/icu_util.h" | 14 #include "base/i18n/icu_util.h" |
17 #include "base/logging.h" | 15 #include "base/logging.h" |
18 #include "base/mac/scoped_nsautorelease_pool.h" | 16 #include "base/mac/scoped_nsautorelease_pool.h" |
19 #include "base/nss_util.h" | 17 #include "base/nss_util.h" |
20 #include "base/path_service.h" | 18 #include "base/path_service.h" |
21 #include "base/process_util.h" | 19 #include "base/process_util.h" |
22 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
23 #include "base/test/multiprocess_test.h" | 21 #include "base/test/multiprocess_test.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) |
194 | 192 |
195 // In some cases, we do not want to see standard error dialogs. | 193 // In some cases, we do not want to see standard error dialogs. |
196 if (!base::debug::BeingDebugged() && | 194 if (!base::debug::BeingDebugged() && |
197 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { | 195 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { |
198 SuppressErrorDialogs(); | 196 SuppressErrorDialogs(); |
199 DebugUtil::SuppressDialogs(); | 197 base::debug::SetSuppressDebugUI(true); |
200 logging::SetLogAssertHandler(UnitTestAssertHandler); | 198 logging::SetLogAssertHandler(UnitTestAssertHandler); |
201 } | 199 } |
202 | 200 |
203 icu_util::Initialize(); | 201 icu_util::Initialize(); |
204 | 202 |
205 #if defined(USE_NSS) | 203 #if defined(USE_NSS) |
206 // Trying to repeatedly initialize and cleanup NSS and NSPR may result in | 204 // Trying to repeatedly initialize and cleanup NSS and NSPR may result in |
207 // a deadlock. Such repeated initialization will happen when using test | 205 // a deadlock. Such repeated initialization will happen when using test |
208 // isolation. Prevent problems by initializing NSS here, so that the cleanup | 206 // isolation. Prevent problems by initializing NSS here, so that the cleanup |
209 // will be done only on process exit. | 207 // will be done only on process exit. |
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 |