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

Unified Diff: content/public/test/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: cleanup 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
Index: content/public/test/test_launcher.cc
===================================================================
--- content/public/test/test_launcher.cc (revision 257128)
+++ content/public/test/test_launcher.cc (working copy)
@@ -60,6 +60,7 @@
const char kManualTestPrefix[] = "MANUAL_";
TestLauncherDelegate* g_launcher_delegate;
+ContentMainParams* g_params;
std::string RemoveAnyPrePrefixes(const std::string& test_name) {
std::string result(test_name);
@@ -476,13 +477,27 @@
command_line->HasSwitch(base::kGTestFilterFlag)) ||
command_line->HasSwitch(base::kGTestListTestsFlag) ||
command_line->HasSwitch(base::kGTestHelpFlag)) {
-#if defined(OS_WIN)
- if (command_line->HasSwitch(kSingleProcessTestsFlag)) {
- sandbox::SandboxInterfaceInfo sandbox_info;
- InitializeSandboxInfo(&sandbox_info);
- InitializeSandbox(&sandbox_info);
- }
-#endif
+
+ // COPY OF RUNCONTENTMAIN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ 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);
+
+ params.instance = GetModuleHandle(NULL);
+ params.sandbox_info = &sandbox_info;
+ #elif defined(OS_LINUX)
+ params.argc = argc;
+ params.argv = const_cast<const char**>(argv);
+ #endif // defined(OS_WIN)
+ // END COPY!!!!!!!!!!!!!!!!!
+
+ g_params = &params;
+
+
return launcher_delegate->RunTestSuite(argc, argv);
}
@@ -518,4 +533,8 @@
return g_launcher_delegate;
}
+ContentMainParams* GetContentMainParams() {
+ return g_params;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698