| 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> |
| 8 |
| 7 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 8 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| 9 #include "base/base_switches.h" | 11 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 12 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 12 #include "base/debug/debugger.h" | 14 #include "base/debug/debugger.h" |
| 13 #include "base/debug/stack_trace.h" | 15 #include "base/debug/stack_trace.h" |
| 14 #include "base/feature_list.h" | 16 #include "base/feature_list.h" |
| 15 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 16 #include "base/files/file_util.h" | 18 #include "base/files/file_util.h" |
| 17 #include "base/i18n/icu_util.h" | 19 #include "base/i18n/icu_util.h" |
| 18 #include "base/logging.h" | 20 #include "base/logging.h" |
| 19 #include "base/macros.h" | 21 #include "base/macros.h" |
| 20 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/ptr_util.h" |
| 21 #include "base/path_service.h" | 23 #include "base/path_service.h" |
| 22 #include "base/process/launch.h" | 24 #include "base/process/launch.h" |
| 23 #include "base/process/memory.h" | 25 #include "base/process/memory.h" |
| 24 #include "base/test/gtest_xml_unittest_result_printer.h" | 26 #include "base/test/gtest_xml_unittest_result_printer.h" |
| 25 #include "base/test/gtest_xml_util.h" | 27 #include "base/test/gtest_xml_util.h" |
| 26 #include "base/test/launcher/unit_test_launcher.h" | 28 #include "base/test/launcher/unit_test_launcher.h" |
| 27 #include "base/test/multiprocess_test.h" | 29 #include "base/test/multiprocess_test.h" |
| 28 #include "base/test/test_switches.h" | 30 #include "base/test/test_switches.h" |
| 29 #include "base/test/test_timeouts.h" | 31 #include "base/test/test_timeouts.h" |
| 30 #include "base/time/time.h" | 32 #include "base/time/time.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 221 |
| 220 // Check to see if we are being run as a client process. | 222 // Check to see if we are being run as a client process. |
| 221 if (!client_func.empty()) | 223 if (!client_func.empty()) |
| 222 return multi_process_function_list::InvokeChildProcessTest(client_func); | 224 return multi_process_function_list::InvokeChildProcessTest(client_func); |
| 223 #if defined(OS_IOS) | 225 #if defined(OS_IOS) |
| 224 test_listener_ios::RegisterTestEndListener(); | 226 test_listener_ios::RegisterTestEndListener(); |
| 225 #endif | 227 #endif |
| 226 | 228 |
| 227 // Set up a FeatureList instance, so that code using that API will not hit a | 229 // Set up a FeatureList instance, so that code using that API will not hit a |
| 228 // an error that it's not set. Cleared by ClearInstanceForTesting() below. | 230 // an error that it's not set. Cleared by ClearInstanceForTesting() below. |
| 229 base::FeatureList::SetInstance(make_scoped_ptr(new base::FeatureList)); | 231 base::FeatureList::SetInstance(base::WrapUnique(new base::FeatureList)); |
| 230 | 232 |
| 231 int result = RUN_ALL_TESTS(); | 233 int result = RUN_ALL_TESTS(); |
| 232 | 234 |
| 233 // Clear the FeatureList that was registered above. | 235 // Clear the FeatureList that was registered above. |
| 234 FeatureList::ClearInstanceForTesting(); | 236 FeatureList::ClearInstanceForTesting(); |
| 235 | 237 |
| 236 #if defined(OS_MACOSX) | 238 #if defined(OS_MACOSX) |
| 237 // This MUST happen before Shutdown() since Shutdown() tears down | 239 // This MUST happen before Shutdown() since Shutdown() tears down |
| 238 // objects (such as NotificationService::current()) that Cocoa | 240 // objects (such as NotificationService::current()) that Cocoa |
| 239 // objects use to remove themselves as observers. | 241 // objects use to remove themselves as observers. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 360 |
| 359 TestTimeouts::Initialize(); | 361 TestTimeouts::Initialize(); |
| 360 | 362 |
| 361 trace_to_file_.BeginTracingFromCommandLineOptions(); | 363 trace_to_file_.BeginTracingFromCommandLineOptions(); |
| 362 } | 364 } |
| 363 | 365 |
| 364 void TestSuite::Shutdown() { | 366 void TestSuite::Shutdown() { |
| 365 } | 367 } |
| 366 | 368 |
| 367 } // namespace base | 369 } // namespace base |
| OLD | NEW |