Index: extensions/shell/test/shell_test.cc |
diff --git a/extensions/shell/test/shell_test.cc b/extensions/shell/test/shell_test.cc |
index 37147766adc55352b795660bd451ac84ebb11249..e18ffcfa91f7f539d55754187e03b6b6926a52cd 100644 |
--- a/extensions/shell/test/shell_test.cc |
+++ b/extensions/shell/test/shell_test.cc |
@@ -4,8 +4,11 @@ |
#include "extensions/shell/test/shell_test.h" |
+#include "base/base_paths.h" |
#include "base/command_line.h" |
+#include "base/files/file_path.h" |
#include "base/logging.h" |
+#include "base/path_service.h" |
#include "content/public/common/content_switches.h" |
#include "extensions/browser/extension_system.h" |
#include "extensions/shell/browser/desktop_controller.h" |
@@ -15,6 +18,18 @@ |
namespace extensions { |
AppShellTest::AppShellTest() : browser_context_(NULL), extension_system_(NULL) { |
+#if defined(OS_MACOSX) |
+ // TODO(phajdan.jr): Make browser tests self-contained on Mac; remove this. |
+ // Set up the application path as though we we are inside the App Shell.app |
+ // bundle, rather than the top-level app_shell_browsertests, because we |
+ // make many assumptions about where the executable is located. |
+ base::FilePath app_shell_path; |
+ CHECK(PathService::Get(base::FILE_EXE, &app_shell_path)); |
+ app_shell_path = app_shell_path.DirName(); |
+ app_shell_path = app_shell_path.Append( |
+ FILE_PATH_LITERAL("App Shell.app/Contents/MacOS/App Shell")); |
+ CHECK(PathService::Override(base::FILE_EXE, app_shell_path)); |
+#endif |
} |
AppShellTest::~AppShellTest() { |