Index: components/test/run_all_unittests.cc |
diff --git a/components/test/run_all_unittests.cc b/components/test/run_all_unittests.cc |
index fbe1fd029722a64b1a6a102cfef9c5c8528da823..5405bac64a6fa64491102c2b1d8fc29b82785046 100644 |
--- a/components/test/run_all_unittests.cc |
+++ b/components/test/run_all_unittests.cc |
@@ -4,11 +4,21 @@ |
#include "base/bind.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/path_service.h" |
#include "base/test/launcher/unit_test_launcher.h" |
#include "base/test/test_suite.h" |
#include "content/public/test/test_content_client_initializer.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "ui/base/resource/resource_bundle.h" |
+#include "ui/base/ui_base_paths.h" |
+ |
+#if defined(OS_MACOSX) |
+#include "base/mac/bundle_locations.h" |
+ |
+// TODO(blundell): Eliminate this dependency by having this file avoid using |
+// the //chrome constant to get the framework name on OS X. crbug.com/348563 |
+#include "chrome/common/chrome_constants.h" |
+#endif |
#if !defined(OS_IOS) |
#include "ui/gl/gl_surface.h" |
@@ -39,9 +49,27 @@ class ComponentsTestSuite : public base::TestSuite { |
ui::android::RegisterJni(env); |
#endif |
+#if defined(OS_MACOSX) && !defined(OS_IOS) |
+ // Look in the framework bundle for resources. |
+ base::FilePath path; |
+ PathService::Get(base::DIR_EXE, &path); |
tfarina
2014/03/05 18:28:22
tiny-nit: I'd name this exe_path.
|
+ |
+ // TODO(blundell): Eliminate this dependency by having this file avoid using |
+ // the //chrome constant to get the framework name on OS X. crbug.com/348563 |
+ path = path.Append(chrome::kFrameworkName); |
+ base::mac::SetOverrideFrameworkBundlePath(path); |
tfarina
2014/03/05 18:28:22
nit:
base::mac::SetOverrideFrameworkBundlePath(
|
+#endif |
+ |
+ ui::RegisterPathProvider(); |
tfarina
2014/03/05 18:28:22
this is to register ui::DIR_LOCALES, ui::DIR_TEST_
|
+ |
// TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile() |
- // so we can load our pak file instead of chrome.pak. |
+ // so we can load our pak file instead of chrome.pak. crbug.com/348563 |
ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
+ base::FilePath resources_pack_path; |
+ PathService::Get(base::DIR_MODULE, &resources_pack_path); |
+ ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
+ resources_pack_path.AppendASCII("resources.pak"), |
+ ui::SCALE_FACTOR_NONE); |
} |
virtual void Shutdown() OVERRIDE { |