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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 #if !defined(OS_WIN) | 374 #if !defined(OS_WIN) |
374 #if defined(OS_IOS) | 375 #if defined(OS_IOS) |
375 i18n::SetICUDefaultLocale("en_US"); | 376 i18n::SetICUDefaultLocale("en_US"); |
376 #else | 377 #else |
377 std::string default_locale(uloc_getDefault()); | 378 std::string default_locale(uloc_getDefault()); |
378 if (EndsWith(default_locale, "POSIX", CompareCase::INSENSITIVE_ASCII)) | 379 if (EndsWith(default_locale, "POSIX", CompareCase::INSENSITIVE_ASCII)) |
379 i18n::SetICUDefaultLocale("en_US"); | 380 i18n::SetICUDefaultLocale("en_US"); |
380 #endif | 381 #endif |
381 #endif | 382 #endif |
382 | 383 |
| 384 // Enable SequencedWorkerPool in tests. |
| 385 // TODO(fdoray): Remove this once the SequencedWorkerPool to TaskScheduler |
| 386 // redirection experiment concludes https://crbug.com/622400. |
| 387 SequencedWorkerPool::EnableForProcess(); |
| 388 |
383 CatchMaybeTests(); | 389 CatchMaybeTests(); |
384 ResetCommandLine(); | 390 ResetCommandLine(); |
385 AddTestLauncherResultPrinter(); | 391 AddTestLauncherResultPrinter(); |
386 | 392 |
387 TestTimeouts::Initialize(); | 393 TestTimeouts::Initialize(); |
388 | 394 |
389 trace_to_file_.BeginTracingFromCommandLineOptions(); | 395 trace_to_file_.BeginTracingFromCommandLineOptions(); |
390 | 396 |
391 base::debug::StartProfiling(GetProfileName()); | 397 base::debug::StartProfiling(GetProfileName()); |
392 } | 398 } |
393 | 399 |
394 void TestSuite::Shutdown() { | 400 void TestSuite::Shutdown() { |
395 base::debug::StopProfiling(); | 401 base::debug::StopProfiling(); |
396 | 402 |
397 // Clear the FeatureList that was created by Initialize(). | 403 // Clear the FeatureList that was created by Initialize(). |
398 if (created_feature_list_) | 404 if (created_feature_list_) |
399 FeatureList::ClearInstanceForTesting(); | 405 FeatureList::ClearInstanceForTesting(); |
400 } | 406 } |
401 | 407 |
402 } // namespace base | 408 } // namespace base |
OLD | NEW |