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/bind.h" | 10 #include "base/bind.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Suppress the "Debug Assertion Failed" dialog. | 274 // Suppress the "Debug Assertion Failed" dialog. |
275 // TODO(hbono): remove this code when gtest has it. | 275 // TODO(hbono): remove this code when gtest has it. |
276 // http://groups.google.com/d/topic/googletestframework/OjuwNlXy5ac/discussion | 276 // http://groups.google.com/d/topic/googletestframework/OjuwNlXy5ac/discussion |
277 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); | 277 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); |
278 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); | 278 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); |
279 #endif // defined(_DEBUG) && defined(_HAS_EXCEPTIONS) && (_HAS_EXCEPTIONS == 1) | 279 #endif // defined(_DEBUG) && defined(_HAS_EXCEPTIONS) && (_HAS_EXCEPTIONS == 1) |
280 #endif // defined(OS_WIN) | 280 #endif // defined(OS_WIN) |
281 } | 281 } |
282 | 282 |
283 void TestSuite::Initialize() { | 283 void TestSuite::Initialize() { |
| 284 #if !defined(OS_IOS) |
| 285 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 286 switches::kWaitForDebugger)) { |
| 287 base::debug::WaitForDebugger(60, true); |
| 288 } |
| 289 #endif |
| 290 |
284 #if defined(OS_MACOSX) && !defined(OS_IOS) | 291 #if defined(OS_MACOSX) && !defined(OS_IOS) |
285 // Some of the app unit tests spin runloops. | 292 // Some of the app unit tests spin runloops. |
286 mock_cr_app::RegisterMockCrApp(); | 293 mock_cr_app::RegisterMockCrApp(); |
287 #endif | 294 #endif |
288 | 295 |
289 #if defined(OS_IOS) | 296 #if defined(OS_IOS) |
290 InitIOSTestMessageLoop(); | 297 InitIOSTestMessageLoop(); |
291 #endif // OS_IOS | 298 #endif // OS_IOS |
292 | 299 |
293 #if defined(OS_ANDROID) | 300 #if defined(OS_ANDROID) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 ResetCommandLine(); | 335 ResetCommandLine(); |
329 #if !defined(OS_IOS) | 336 #if !defined(OS_IOS) |
330 AddTestLauncherResultPrinter(); | 337 AddTestLauncherResultPrinter(); |
331 #endif // !defined(OS_IOS) | 338 #endif // !defined(OS_IOS) |
332 | 339 |
333 TestTimeouts::Initialize(); | 340 TestTimeouts::Initialize(); |
334 } | 341 } |
335 | 342 |
336 void TestSuite::Shutdown() { | 343 void TestSuite::Shutdown() { |
337 } | 344 } |
OLD | NEW |