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

Side by Side Diff: chrome/test/base/chrome_test_launcher.cc

Issue 190663012: Run ContentMain in a browser_test's browser process. This removes duplication of code in the browse… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: try to fix android by restoring old path just for it Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/chrome_render_view_test.cc ('k') | chrome/test/base/chrome_test_suite.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 "chrome/test/base/chrome_test_launcher.h" 5 #include "chrome/test/base/chrome_test_launcher.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/leak_annotations.h" 8 #include "base/debug/leak_annotations.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // file:// access for ChromeOS. 79 // file:// access for ChromeOS.
80 new_command_line.AppendSwitch(switches::kAllowFileAccess); 80 new_command_line.AppendSwitch(switches::kAllowFileAccess);
81 81
82 *command_line = new_command_line; 82 *command_line = new_command_line;
83 return true; 83 return true;
84 } 84 }
85 85
86 protected: 86 protected:
87 virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE { 87 virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE {
88 #if defined(OS_WIN) || defined (OS_LINUX)
89 return new ChromeMainDelegate(); 88 return new ChromeMainDelegate();
90 #else
91 // This delegate is only guaranteed to link on linux and windows, so just
92 // bail out if we are on any other platform.
93 NOTREACHED();
94 return NULL;
95 #endif
96 } 89 }
97 90
98 virtual void AdjustDefaultParallelJobs(int* default_jobs) OVERRIDE { 91 virtual void AdjustDefaultParallelJobs(int* default_jobs) OVERRIDE {
99 #if defined(OS_WIN) 92 #if defined(OS_WIN)
100 if (CommandLine::ForCurrentProcess()->HasSwitch( 93 if (CommandLine::ForCurrentProcess()->HasSwitch(
101 switches::kAshBrowserTests)) { 94 switches::kAshBrowserTests)) {
102 *default_jobs = 1; 95 *default_jobs = 1;
103 fprintf(stdout, 96 fprintf(stdout,
104 "Disabling test parallelization for --ash-browsertests.\n"); 97 "Disabling test parallelization for --ash-browsertests.\n");
105 fflush(stdout); 98 fflush(stdout);
(...skipping 22 matching lines...) Expand all
128 // all other code. 121 // all other code.
129 chrome::ChromeBreakpadClient* breakpad_client = 122 chrome::ChromeBreakpadClient* breakpad_client =
130 new chrome::ChromeBreakpadClient(); 123 new chrome::ChromeBreakpadClient();
131 ANNOTATE_LEAKING_OBJECT_PTR(breakpad_client); 124 ANNOTATE_LEAKING_OBJECT_PTR(breakpad_client);
132 breakpad::SetBreakpadClient(breakpad_client); 125 breakpad::SetBreakpadClient(breakpad_client);
133 #endif 126 #endif
134 127
135 ChromeTestLauncherDelegate launcher_delegate(runner); 128 ChromeTestLauncherDelegate launcher_delegate(runner);
136 return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); 129 return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv);
137 } 130 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_render_view_test.cc ('k') | chrome/test/base/chrome_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698