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

Unified Diff: chrome/test/in_process_browser_test.cc

Issue 2729002: Run in-process browser tests using the sandbox. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/interactive_ui/interactive_ui_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/in_process_browser_test.cc
===================================================================
--- chrome/test/in_process_browser_test.cc (revision 49137)
+++ chrome/test/in_process_browser_test.cc (working copy)
@@ -137,10 +137,6 @@
command_line->AppendSwitchWithValue(switches::kUserDataDir,
user_data_dir.ToWStringHack());
- // For some reason the sandbox wasn't happy running in test mode. These
- // tests aren't intended to test the sandbox, so we turn it off.
- command_line->AppendSwitch(switches::kNoSandbox);
-
// Don't show the first run ui.
command_line->AppendSwitch(switches::kNoFirstRun);
@@ -154,8 +150,14 @@
if (command_line->HasSwitch(switches::kSingleProcess))
RenderProcessHost::set_run_renderer_in_process(true);
- // Explicitly set the path of the exe used for the renderer and plugin,
- // otherwise they'll try to use unit_test.exe.
+#if defined(OS_WIN)
+ // The Windows sandbox requires that the browser and child processes are the
+ // same binary. So we launch browser_process.exe which loads chrome.dll
+ command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath,
+ command_line->GetProgram().value());
+#else
+ // Explicitly set the path of the binary used for child processes, otherwise
+ // they'll try to use browser_tests which doesn't contain ChromeMain.
FilePath subprocess_path;
PathService::Get(base::FILE_EXE, &subprocess_path);
subprocess_path = subprocess_path.DirName();
@@ -163,6 +165,7 @@
chrome::kBrowserProcessExecutablePath));
command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath,
subprocess_path.ToWStringHack());
+#endif
// Enable warning level logging so that we can see when bad stuff happens.
command_line->AppendSwitch(switches::kEnableLogging);
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/interactive_ui/interactive_ui_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698