Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: base/test/test_suite.cc

Issue 2231813002: Revert of Adds support for running unittests using XCTest on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/test/test_support_ios.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | base/test/test_support_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698