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" |
34 #include "base/time/time.h" | 35 #include "base/time/time.h" |
35 #include "build/build_config.h" | 36 #include "build/build_config.h" |
36 #include "testing/gmock/include/gmock/gmock.h" | 37 #include "testing/gmock/include/gmock/gmock.h" |
37 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
38 #include "testing/multiprocess_func_list.h" | 39 #include "testing/multiprocess_func_list.h" |
39 | 40 |
40 #if defined(OS_MACOSX) | 41 #if defined(OS_MACOSX) |
41 #include "base/mac/scoped_nsautorelease_pool.h" | 42 #include "base/mac/scoped_nsautorelease_pool.h" |
42 #if defined(OS_IOS) | 43 #if defined(OS_IOS) |
43 #include "base/test/test_listener_ios.h" | 44 #include "base/test/test_listener_ios.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 #if !defined(OS_WIN) | 363 #if !defined(OS_WIN) |
363 #if defined(OS_IOS) | 364 #if defined(OS_IOS) |
364 i18n::SetICUDefaultLocale("en_US"); | 365 i18n::SetICUDefaultLocale("en_US"); |
365 #else | 366 #else |
366 std::string default_locale(uloc_getDefault()); | 367 std::string default_locale(uloc_getDefault()); |
367 if (EndsWith(default_locale, "POSIX", CompareCase::INSENSITIVE_ASCII)) | 368 if (EndsWith(default_locale, "POSIX", CompareCase::INSENSITIVE_ASCII)) |
368 i18n::SetICUDefaultLocale("en_US"); | 369 i18n::SetICUDefaultLocale("en_US"); |
369 #endif | 370 #endif |
370 #endif | 371 #endif |
371 | 372 |
| 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 |
372 CatchMaybeTests(); | 378 CatchMaybeTests(); |
373 ResetCommandLine(); | 379 ResetCommandLine(); |
374 AddTestLauncherResultPrinter(); | 380 AddTestLauncherResultPrinter(); |
375 | 381 |
376 TestTimeouts::Initialize(); | 382 TestTimeouts::Initialize(); |
377 | 383 |
378 trace_to_file_.BeginTracingFromCommandLineOptions(); | 384 trace_to_file_.BeginTracingFromCommandLineOptions(); |
379 | 385 |
380 base::debug::StartProfiling(GetProfileName()); | 386 base::debug::StartProfiling(GetProfileName()); |
381 } | 387 } |
382 | 388 |
383 void TestSuite::Shutdown() { | 389 void TestSuite::Shutdown() { |
384 base::debug::StopProfiling(); | 390 base::debug::StopProfiling(); |
385 | 391 |
386 // Clear the FeatureList that was created by Initialize(). | 392 // Clear the FeatureList that was created by Initialize(). |
387 if (created_feature_list_) | 393 if (created_feature_list_) |
388 FeatureList::ClearInstanceForTesting(); | 394 FeatureList::ClearInstanceForTesting(); |
389 } | 395 } |
390 | 396 |
391 } // namespace base | 397 } // namespace base |
OLD | NEW |