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

Unified Diff: headless/test/headless_browser_test.cc

Issue 2778983002: Fix browser tests on Mac (Closed)
Patch Set: nit change on #if defined on DefaultSizes test Created 3 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
« no previous file with comments | « headless/public/headless_browser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/test/headless_browser_test.cc
diff --git a/headless/test/headless_browser_test.cc b/headless/test/headless_browser_test.cc
index 44e3f9b5d7d9b482ece969d46a8d24fc09f38dcf..a5191a3ccae26e9834cff332d7c04ec4be4806a3 100644
--- a/headless/test/headless_browser_test.cc
+++ b/headless/test/headless_browser_test.cc
@@ -5,8 +5,10 @@
#include "headless/test/headless_browser_test.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
+#include "base/path_service.h"
#include "base/run_loop.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
@@ -121,6 +123,14 @@ void LoadObserver::OnResponseReceived(
}
HeadlessBrowserTest::HeadlessBrowserTest() {
+#if defined(OS_MACOSX)
+ // On Mac the source root is not set properly. We override it by assuming
+ // that is two directories up from the execution test file.
+ base::FilePath dir_exe_path;
+ CHECK(PathService::Get(base::DIR_EXE, &dir_exe_path));
+ dir_exe_path = dir_exe_path.Append("../../");
+ CHECK(PathService::Override(base::DIR_SOURCE_ROOT, dir_exe_path));
+#endif // defined(OS_MACOSX)
base::FilePath headless_test_data(FILE_PATH_LITERAL("headless/test/data"));
CreateTestServer(headless_test_data);
}
« no previous file with comments | « headless/public/headless_browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698