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

Unified Diff: chrome/test/in_process_browser_test.cc

Issue 146057: Making browser test work (again) on Linux (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | 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 19071)
+++ chrome/test/in_process_browser_test.cc (working copy)
@@ -187,13 +187,28 @@
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));
+
browser_ = CreateBrowser(profile);
RunTestOnMainThread();
- BrowserList::const_reverse_iterator browser =
- BrowserList::begin_last_active();
- for (; browser != BrowserList::end_last_active(); ++browser)
+ BrowserList::const_iterator browser = BrowserList::begin();
+ for (; browser != BrowserList::end(); ++browser)
(*browser)->CloseAllTabs();
// Stop the HTTP server.
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698