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