| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 #endif | 231 #endif |
| 232 | 232 |
| 233 Initialize(); | 233 Initialize(); |
| 234 std::string client_func = | 234 std::string client_func = |
| 235 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 235 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 236 switches::kTestChildProcess); | 236 switches::kTestChildProcess); |
| 237 | 237 |
| 238 // Check to see if we are being run as a client process. | 238 // Check to see if we are being run as a client process. |
| 239 if (!client_func.empty()) | 239 if (!client_func.empty()) |
| 240 return multi_process_function_list::InvokeChildProcessTest(client_func); | 240 return multi_process_function_list::InvokeChildProcessTest(client_func); |
| 241 | |
| 242 #if defined(OS_IOS) | 241 #if defined(OS_IOS) |
| 243 if (IsRunningWithXCTest()) { | |
| 244 // XCTest will drive the tests if running in XCTest mode on iOS. There is | |
| 245 // no need to run the tests here or to tear down the test suite. | |
| 246 return 0; | |
| 247 } | |
| 248 test_listener_ios::RegisterTestEndListener(); | 242 test_listener_ios::RegisterTestEndListener(); |
| 249 #endif | 243 #endif |
| 250 | 244 |
| 251 int result = RUN_ALL_TESTS(); | 245 int result = RUN_ALL_TESTS(); |
| 252 | 246 |
| 253 #if defined(OS_MACOSX) | 247 #if defined(OS_MACOSX) |
| 254 // This MUST happen before Shutdown() since Shutdown() tears down | 248 // This MUST happen before Shutdown() since Shutdown() tears down |
| 255 // objects (such as NotificationService::current()) that Cocoa | 249 // objects (such as NotificationService::current()) that Cocoa |
| 256 // objects use to remove themselves as observers. | 250 // objects use to remove themselves as observers. |
| 257 scoped_pool.Recycle(); | 251 scoped_pool.Recycle(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 383 |
| 390 void TestSuite::Shutdown() { | 384 void TestSuite::Shutdown() { |
| 391 base::debug::StopProfiling(); | 385 base::debug::StopProfiling(); |
| 392 | 386 |
| 393 // Clear the FeatureList that was created by Initialize(). | 387 // Clear the FeatureList that was created by Initialize(). |
| 394 if (created_feature_list_) | 388 if (created_feature_list_) |
| 395 FeatureList::ClearInstanceForTesting(); | 389 FeatureList::ClearInstanceForTesting(); |
| 396 } | 390 } |
| 397 | 391 |
| 398 } // namespace base | 392 } // namespace base |
| OLD | NEW |