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

Unified Diff: content/public/test/test_launcher.cc

Issue 190853004: Convert ContentMain to take a struct instead of parameters that vary depending on the platform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/main_function_params.h ('k') | content/shell/app/shell_content_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_launcher.cc
===================================================================
--- content/public/test/test_launcher.cc (revision 255735)
+++ content/public/test/test_launcher.cc (working copy)
@@ -427,35 +427,34 @@
TestLauncherDelegate::~TestLauncherDelegate() {
}
+#if defined(OS_WIN) || defined(OS_LINUX)
bool ShouldRunContentMain() {
-#if defined(OS_WIN) || defined(OS_LINUX)
CommandLine* command_line = CommandLine::ForCurrentProcess();
return command_line->HasSwitch(switches::kProcessType) ||
command_line->HasSwitch(kLaunchAsBrowser);
-#else
return false;
-#endif // defined(OS_WIN) || defined(OS_LINUX)
}
int RunContentMain(int argc, char** argv,
TestLauncherDelegate* launcher_delegate) {
+ scoped_ptr<ContentMainDelegate> chrome_main_delegate(
+ launcher_delegate->CreateContentMainDelegate());
+ ContentMainParams params(chrome_main_delegate.get());
+
#if defined(OS_WIN)
sandbox::SandboxInterfaceInfo sandbox_info = {0};
InitializeSandboxInfo(&sandbox_info);
- scoped_ptr<ContentMainDelegate> chrome_main_delegate(
- launcher_delegate->CreateContentMainDelegate());
- return ContentMain(GetModuleHandle(NULL),
- &sandbox_info,
- chrome_main_delegate.get());
+
+ params.instance = GetModuleHandle(NULL);
+ params.sandbox_info = &sandbox_info;
#elif defined(OS_LINUX)
- scoped_ptr<ContentMainDelegate> chrome_main_delegate(
- launcher_delegate->CreateContentMainDelegate());
- return ContentMain(argc, const_cast<const char**>(argv),
- chrome_main_delegate.get());
+ params.argc = argc;
+ params.argv = const_cast<const char**>(argv);
#endif // defined(OS_WIN)
- NOTREACHED();
- return 0;
+
+ return ContentMain(params);
}
+#endif
int LaunchTests(TestLauncherDelegate* launcher_delegate,
int default_jobs,
@@ -487,8 +486,10 @@
return launcher_delegate->RunTestSuite(argc, argv);
}
+#if defined(OS_WIN) || defined(OS_LINUX)
if (ShouldRunContentMain())
return RunContentMain(argc, argv, launcher_delegate);
+#endif
base::AtExitManager at_exit;
testing::InitGoogleTest(&argc, argv);
« no previous file with comments | « content/public/common/main_function_params.h ('k') | content/shell/app/shell_content_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698