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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "base/path_service.h" | 24 #include "base/path_service.h" |
25 #include "base/process/launch.h" | 25 #include "base/process/launch.h" |
26 #include "base/process/memory.h" | 26 #include "base/process/memory.h" |
27 #include "base/test/gtest_xml_unittest_result_printer.h" | 27 #include "base/test/gtest_xml_unittest_result_printer.h" |
28 #include "base/test/gtest_xml_util.h" | 28 #include "base/test/gtest_xml_util.h" |
29 #include "base/test/icu_test_util.h" | 29 #include "base/test/icu_test_util.h" |
30 #include "base/test/launcher/unit_test_launcher.h" | 30 #include "base/test/launcher/unit_test_launcher.h" |
31 #include "base/test/multiprocess_test.h" | 31 #include "base/test/multiprocess_test.h" |
32 #include "base/test/test_switches.h" | 32 #include "base/test/test_switches.h" |
33 #include "base/test/test_timeouts.h" | 33 #include "base/test/test_timeouts.h" |
34 #include "base/threading/sequenced_worker_pool.h" | |
35 #include "base/time/time.h" | 34 #include "base/time/time.h" |
36 #include "build/build_config.h" | 35 #include "build/build_config.h" |
37 #include "testing/gmock/include/gmock/gmock.h" | 36 #include "testing/gmock/include/gmock/gmock.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
39 #include "testing/multiprocess_func_list.h" | 38 #include "testing/multiprocess_func_list.h" |
40 | 39 |
41 #if defined(OS_MACOSX) | 40 #if defined(OS_MACOSX) |
42 #include "base/mac/scoped_nsautorelease_pool.h" | 41 #include "base/mac/scoped_nsautorelease_pool.h" |
43 #if defined(OS_IOS) | 42 #if defined(OS_IOS) |
44 #include "base/test/test_listener_ios.h" | 43 #include "base/test/test_listener_ios.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 #if !defined(OS_WIN) | 362 #if !defined(OS_WIN) |
364 #if defined(OS_IOS) | 363 #if defined(OS_IOS) |
365 i18n::SetICUDefaultLocale("en_US"); | 364 i18n::SetICUDefaultLocale("en_US"); |
366 #else | 365 #else |
367 std::string default_locale(uloc_getDefault()); | 366 std::string default_locale(uloc_getDefault()); |
368 if (EndsWith(default_locale, "POSIX", CompareCase::INSENSITIVE_ASCII)) | 367 if (EndsWith(default_locale, "POSIX", CompareCase::INSENSITIVE_ASCII)) |
369 i18n::SetICUDefaultLocale("en_US"); | 368 i18n::SetICUDefaultLocale("en_US"); |
370 #endif | 369 #endif |
371 #endif | 370 #endif |
372 | 371 |
373 // Enable SequencedWorkerPool in tests. | |
374 // TODO(fdoray): Remove this once the SequencedWorkerPool to TaskScheduler | |
375 // redirection experiment concludes https://crbug.com/622400. | |
376 SequencedWorkerPool::EnableForProcess(); | |
377 | |
378 CatchMaybeTests(); | 372 CatchMaybeTests(); |
379 ResetCommandLine(); | 373 ResetCommandLine(); |
380 AddTestLauncherResultPrinter(); | 374 AddTestLauncherResultPrinter(); |
381 | 375 |
382 TestTimeouts::Initialize(); | 376 TestTimeouts::Initialize(); |
383 | 377 |
384 trace_to_file_.BeginTracingFromCommandLineOptions(); | 378 trace_to_file_.BeginTracingFromCommandLineOptions(); |
385 | 379 |
386 base::debug::StartProfiling(GetProfileName()); | 380 base::debug::StartProfiling(GetProfileName()); |
387 } | 381 } |
388 | 382 |
389 void TestSuite::Shutdown() { | 383 void TestSuite::Shutdown() { |
390 base::debug::StopProfiling(); | 384 base::debug::StopProfiling(); |
391 | 385 |
392 // Clear the FeatureList that was created by Initialize(). | 386 // Clear the FeatureList that was created by Initialize(). |
393 if (created_feature_list_) | 387 if (created_feature_list_) |
394 FeatureList::ClearInstanceForTesting(); | 388 FeatureList::ClearInstanceForTesting(); |
395 } | 389 } |
396 | 390 |
397 } // namespace base | 391 } // namespace base |
OLD | NEW |