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

Unified Diff: chrome/test/in_process_browser_test.cc

Issue 4947002: Mac: Let browser_tests run in bundled mode for their whole lifetime. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: test Created 10 years, 1 month 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/test/in_process_browser_test.h ('k') | chrome/test/plugin/pdf_browsertest.cc » ('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
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc
index cd6669fdd83aba4f4259a03f7b59a243fcfd7f4d..78781fc31f3e980814bf7985fa9d0d4227beb2f0 100644
--- a/chrome/test/in_process_browser_test.cc
+++ b/chrome/test/in_process_browser_test.cc
@@ -43,14 +43,18 @@
#include "net/test/test_server.h"
#include "sandbox/src/dep.h"
-#if defined(OS_WIN)
-#include "chrome/browser/views/frame/browser_view.h"
-#endif
-
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/cros/cros_library.h"
#endif // defined(OS_CHROMEOS)
+#if defined(OS_MACOSX)
+#include "base/mac_util.h"
+#endif
+
+#if defined(OS_WIN)
+#include "chrome/browser/views/frame/browser_view.h"
+#endif
+
namespace {
void InitializeBrowser(Browser* browser) {
@@ -75,12 +79,32 @@ static const char kBrowserTestType[] = "browser";
InProcessBrowserTest::InProcessBrowserTest()
: browser_(NULL),
- test_server_(net::TestServer::TYPE_HTTP,
- FilePath(FILE_PATH_LITERAL("chrome/test/data"))),
show_window_(false),
dom_automation_enabled_(false),
tab_closeable_state_watcher_enabled_(false),
original_single_process_(false) {
+#if defined(OS_MACOSX)
+ mac_util::SetOverrideAmIBundled(true);
+#endif
+
+ // 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));
+
+ test_server_.reset(new net::TestServer(
+ net::TestServer::TYPE_HTTP,
+ FilePath(FILE_PATH_LITERAL("chrome/test/data"))));
}
InProcessBrowserTest::~InProcessBrowserTest() {
@@ -154,9 +178,6 @@ void InProcessBrowserTest::SetUp() {
// 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();
- subprocess_path = subprocess_path.AppendASCII(WideToASCII(
- chrome::kBrowserProcessExecutablePath));
#if defined(OS_MACOSX)
// Recreate the real environment, run the helper within the app bundle.
subprocess_path = subprocess_path.DirName().DirName();
@@ -205,21 +226,6 @@ void InProcessBrowserTest::SetUp() {
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));
-
BrowserMain(params);
TearDownInProcessBrowserTestFixture();
}
« no previous file with comments | « chrome/test/in_process_browser_test.h ('k') | chrome/test/plugin/pdf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698