diff options
Diffstat (limited to 'chrome/test/in_process_browser_test.cc')
-rw-r--r-- | chrome/test/in_process_browser_test.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index d71a93a..80c0ce9 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -173,6 +173,28 @@ void InProcessBrowserTest::SetUp() { host_resolver_.get()); SetUpInProcessBrowserTestFixture(); + + // Before we run the browser, we have to hack the path to the exe to match + // what it would be if Chrome was running, because it is used to fork renderer + // processes, on Linux at least (failure to do so will cause a browser_test to + // be run instead of a renderer). + FilePath chrome_path; + CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); + chrome_path = chrome_path.DirName(); +#if defined(OS_WIN) + chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); +#elif defined(OS_POSIX) + chrome_path = chrome_path.Append( + WideToASCII(chrome::kBrowserProcessExecutablePath)); +#endif + CHECK(PathService::Override(base::FILE_EXE, chrome_path)); + +#if defined(OS_LINUX) + // Initialize the RenderSandbox and Zygote hosts. Apparently they get used + // for InProcessBrowserTest, and this is not the normal browser startup path. + Singleton<LinuxHostInit>::get(); +#endif + BrowserMain(params); TearDownInProcessBrowserTestFixture(); } @@ -234,32 +256,10 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() { return; } - - // Before we run the browser, we have to hack the path to the exe to match - // what it would be if Chrome was running, because it is used to fork renderer - // processes, on Linux at least (failure to do so will cause a browser_test to - // be run instead of a renderer). - FilePath chrome_path; - CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); - chrome_path = chrome_path.DirName(); -#if defined(OS_WIN) - chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); -#elif defined(OS_POSIX) - chrome_path = chrome_path.Append( - WideToASCII(chrome::kBrowserProcessExecutablePath)); -#endif - CHECK(PathService::Override(base::FILE_EXE, chrome_path)); - ChromeThread::PostTask( ChromeThread::IO, FROM_HERE, NewRunnableFunction(chrome_browser_net::SetUrlRequestMocksEnabled, true)); -#if defined(OS_LINUX) - // Initialize the RenderSandbox and Zygote hosts. Apparently they get used - // for InProcessBrowserTest, and this is not the normal browser startup path. - Singleton<LinuxHostInit>::get(); -#endif - browser_ = CreateBrowser(profile); // Start the timeout timer to prevent hangs. |