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

Side by Side Diff: content/test/content_test_launcher.cc

Issue 311943002: Same shutdown process for content_browsertests on android/non android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another merge attempt. Created 6 years, 6 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 | « content/public/test/browser_test_base.cc ('k') | no next file » | 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 "content/public/test/test_launcher.h" 5 #include "content/public/test/test_launcher.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/i18n/icu_util.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "base/path_service.h" 12 #include "base/path_service.h"
12 #include "base/process/memory.h" 13 #include "base/process/memory.h"
13 #include "base/sys_info.h" 14 #include "base/sys_info.h"
14 #include "base/test/test_suite.h" 15 #include "base/test/test_suite.h"
15 #include "base/test/test_timeouts.h" 16 #include "base/test/test_timeouts.h"
16 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
17 #include "content/public/test/content_test_suite_base.h" 18 #include "content/public/test/content_test_suite_base.h"
18 #include "content/shell/app/shell_main_delegate.h" 19 #include "content/shell/app/shell_main_delegate.h"
19 #include "content/shell/common/shell_switches.h" 20 #include "content/shell/common/shell_switches.h"
(...skipping 24 matching lines...) Expand all
44 ContentBrowserTestSuite(int argc, char** argv) 45 ContentBrowserTestSuite(int argc, char** argv)
45 : ContentTestSuiteBase(argc, argv) { 46 : ContentTestSuiteBase(argc, argv) {
46 } 47 }
47 virtual ~ContentBrowserTestSuite() { 48 virtual ~ContentBrowserTestSuite() {
48 } 49 }
49 50
50 protected: 51 protected:
51 virtual void Initialize() OVERRIDE { 52 virtual void Initialize() OVERRIDE {
52 53
53 #if defined(OS_ANDROID) 54 #if defined(OS_ANDROID)
55 base::i18n::AllowMultipleInitializeCallsForTesting();
56 base::i18n::InitializeICU();
57
54 // This needs to be done before base::TestSuite::Initialize() is called, 58 // This needs to be done before base::TestSuite::Initialize() is called,
55 // as it also tries to set MessagePumpForUIFactory. 59 // as it also tries to set MessagePumpForUIFactory.
56 if (!base::MessageLoop::InitMessagePumpForUIFactory( 60 if (!base::MessageLoop::InitMessagePumpForUIFactory(
57 &CreateMessagePumpForUI)) 61 &CreateMessagePumpForUI))
58 VLOG(0) << "MessagePumpForUIFactory already set, unable to override."; 62 VLOG(0) << "MessagePumpForUIFactory already set, unable to override.";
59 63
60 // For all other platforms, we call ContentMain for browser tests which goes 64 // For all other platforms, we call ContentMain for browser tests which goes
61 // through the normal browser initialization paths. For Android, we must set 65 // through the normal browser initialization paths. For Android, we must set
62 // things up manually. 66 // things up manually.
63 content_client_.reset(new ShellContentClient); 67 content_client_.reset(new ShellContentClient);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); 123 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate);
120 }; 124 };
121 125
122 } // namespace content 126 } // namespace content
123 127
124 int main(int argc, char** argv) { 128 int main(int argc, char** argv) {
125 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); 129 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2);
126 content::ContentTestLauncherDelegate launcher_delegate; 130 content::ContentTestLauncherDelegate launcher_delegate;
127 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); 131 return LaunchTests(&launcher_delegate, default_jobs, argc, argv);
128 } 132 }
OLDNEW
« no previous file with comments | « content/public/test/browser_test_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698