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

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

Issue 10701172: Replace MessagePumpForUI with MessagePumpDefault in unit tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased. Created 8 years, 5 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 | « base/base.gyp ('k') | 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 "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 18 matching lines...) Expand all
29 #include "base/test/test_listener_ios.h" 29 #include "base/test/test_listener_ios.h"
30 #else 30 #else
31 #include "base/test/mock_chrome_application_mac.h" 31 #include "base/test/mock_chrome_application_mac.h"
32 #endif // OS_IOS 32 #endif // OS_IOS
33 #endif // OS_MACOSX 33 #endif // OS_MACOSX
34 34
35 #if defined(OS_ANDROID) 35 #if defined(OS_ANDROID)
36 #include "base/test/test_support_android.h" 36 #include "base/test/test_support_android.h"
37 #endif 37 #endif
38 38
39 #if defined(OS_IOS)
40 #include "base/test/test_support_ios.h"
41 #endif
42
39 #if defined(TOOLKIT_GTK) 43 #if defined(TOOLKIT_GTK)
40 #include <gtk/gtk.h> 44 #include <gtk/gtk.h>
41 #endif 45 #endif
42 46
43 namespace { 47 namespace {
44 48
45 class MaybeTestDisabler : public testing::EmptyTestEventListener { 49 class MaybeTestDisabler : public testing::EmptyTestEventListener {
46 public: 50 public:
47 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { 51 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE {
48 ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info)) 52 ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info))
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 #endif // defined(_DEBUG) && defined(_HAS_EXCEPTIONS) && (_HAS_EXCEPTIONS == 1) 300 #endif // defined(_DEBUG) && defined(_HAS_EXCEPTIONS) && (_HAS_EXCEPTIONS == 1)
297 #endif // defined(OS_WIN) 301 #endif // defined(OS_WIN)
298 } 302 }
299 303
300 void TestSuite::Initialize() { 304 void TestSuite::Initialize() {
301 #if defined(OS_MACOSX) && !defined(OS_IOS) 305 #if defined(OS_MACOSX) && !defined(OS_IOS)
302 // Some of the app unit tests spin runloops. 306 // Some of the app unit tests spin runloops.
303 mock_cr_app::RegisterMockCrApp(); 307 mock_cr_app::RegisterMockCrApp();
304 #endif 308 #endif
305 309
310 #if defined(OS_IOS)
311 InitIOSTestMessageLoop();
312 #endif // OS_IOS
313
306 #if defined(OS_ANDROID) 314 #if defined(OS_ANDROID)
307 InitAndroidTest(); 315 InitAndroidTest();
308 #else 316 #else
309 // Initialize logging. 317 // Initialize logging.
310 FilePath exe; 318 FilePath exe;
311 PathService::Get(base::FILE_EXE, &exe); 319 PathService::Get(base::FILE_EXE, &exe);
312 FilePath log_filename = exe.ReplaceExtension(FILE_PATH_LITERAL("log")); 320 FilePath log_filename = exe.ReplaceExtension(FILE_PATH_LITERAL("log"));
313 logging::InitLogging( 321 logging::InitLogging(
314 log_filename.value().c_str(), 322 log_filename.value().c_str(),
315 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, 323 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 !CommandLine::ForCurrentProcess()->HasSwitch( 356 !CommandLine::ForCurrentProcess()->HasSwitch(
349 switches::kSingleProcessChromeFlag)) { 357 switches::kSingleProcessChromeFlag)) {
350 WatchAtExitManager(); 358 WatchAtExitManager();
351 } 359 }
352 360
353 TestTimeouts::Initialize(); 361 TestTimeouts::Initialize();
354 } 362 }
355 363
356 void TestSuite::Shutdown() { 364 void TestSuite::Shutdown() {
357 } 365 }
OLDNEW
« no previous file with comments | « base/base.gyp ('k') | base/test/test_support_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698