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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 #endif // defined(OS_WIN) | 324 #endif // defined(OS_WIN) |
325 | 325 |
326 // In some cases, we do not want to see standard error dialogs. | 326 // In some cases, we do not want to see standard error dialogs. |
327 if (!debug::BeingDebugged() && | 327 if (!debug::BeingDebugged() && |
328 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { | 328 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { |
329 SuppressErrorDialogs(); | 329 SuppressErrorDialogs(); |
330 debug::SetSuppressDebugUI(true); | 330 debug::SetSuppressDebugUI(true); |
331 logging::SetLogAssertHandler(UnitTestAssertHandler); | 331 logging::SetLogAssertHandler(UnitTestAssertHandler); |
332 } | 332 } |
333 | 333 |
334 i18n::InitializeICU(); | 334 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 335 switches::kTestDoNotInitializeIcu)) { |
| 336 i18n::InitializeICU(); |
| 337 } |
335 // On the Mac OS X command line, the default locale is *_POSIX. In Chromium, | 338 // On the Mac OS X command line, the default locale is *_POSIX. In Chromium, |
336 // the locale is set via an OS X locale API and is never *_POSIX. | 339 // the locale is set via an OS X locale API and is never *_POSIX. |
337 // Some tests (such as those involving word break iterator) will behave | 340 // Some tests (such as those involving word break iterator) will behave |
338 // differently and fail if we use *POSIX locale. Setting it to en_US here | 341 // differently and fail if we use *POSIX locale. Setting it to en_US here |
339 // does not affect tests that explicitly overrides the locale for testing. | 342 // does not affect tests that explicitly overrides the locale for testing. |
340 // This can be an issue on all platforms other than Windows. | 343 // This can be an issue on all platforms other than Windows. |
341 // TODO(jshin): Should we set the locale via an OS X locale API here? | 344 // TODO(jshin): Should we set the locale via an OS X locale API here? |
342 #if !defined(OS_WIN) | 345 #if !defined(OS_WIN) |
343 #if defined(OS_IOS) | 346 #if defined(OS_IOS) |
344 i18n::SetICUDefaultLocale("en_US"); | 347 i18n::SetICUDefaultLocale("en_US"); |
(...skipping 10 matching lines...) Expand all Loading... |
355 | 358 |
356 TestTimeouts::Initialize(); | 359 TestTimeouts::Initialize(); |
357 | 360 |
358 trace_to_file_.BeginTracingFromCommandLineOptions(); | 361 trace_to_file_.BeginTracingFromCommandLineOptions(); |
359 } | 362 } |
360 | 363 |
361 void TestSuite::Shutdown() { | 364 void TestSuite::Shutdown() { |
362 } | 365 } |
363 | 366 |
364 } // namespace base | 367 } // namespace base |
OLD | NEW |