| 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 |
| 241 #if defined(OS_IOS) | 242 #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 } |
| 242 test_listener_ios::RegisterTestEndListener(); | 248 test_listener_ios::RegisterTestEndListener(); |
| 243 #endif | 249 #endif |
| 244 | 250 |
| 245 int result = RUN_ALL_TESTS(); | 251 int result = RUN_ALL_TESTS(); |
| 246 | 252 |
| 247 #if defined(OS_MACOSX) | 253 #if defined(OS_MACOSX) |
| 248 // This MUST happen before Shutdown() since Shutdown() tears down | 254 // This MUST happen before Shutdown() since Shutdown() tears down |
| 249 // objects (such as NotificationService::current()) that Cocoa | 255 // objects (such as NotificationService::current()) that Cocoa |
| 250 // objects use to remove themselves as observers. | 256 // objects use to remove themselves as observers. |
| 251 scoped_pool.Recycle(); | 257 scoped_pool.Recycle(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 389 |
| 384 void TestSuite::Shutdown() { | 390 void TestSuite::Shutdown() { |
| 385 base::debug::StopProfiling(); | 391 base::debug::StopProfiling(); |
| 386 | 392 |
| 387 // Clear the FeatureList that was created by Initialize(). | 393 // Clear the FeatureList that was created by Initialize(). |
| 388 if (created_feature_list_) | 394 if (created_feature_list_) |
| 389 FeatureList::ClearInstanceForTesting(); | 395 FeatureList::ClearInstanceForTesting(); |
| 390 } | 396 } |
| 391 | 397 |
| 392 } // namespace base | 398 } // namespace base |
| OLD | NEW |