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..db5ed37ec6251c7bf728188270753bda93a4ebbb 100644 |
--- a/components/test/run_all_unittests.cc |
+++ b/components/test/run_all_unittests.cc |
@@ -4,11 +4,18 @@ |
#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" |
+#include "chrome/common/chrome_constants.h" |
+#endif |
#if !defined(OS_IOS) |
#include "ui/gl/gl_surface.h" |
@@ -39,9 +46,25 @@ 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); |
+ path = path.Append(chrome::kFrameworkName); |
+ base::mac::SetOverrideFrameworkBundlePath(path); |
+#endif |
+ |
+ ui::RegisterPathProvider(); |
+ |
// TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile() |
// so we can load our pak file instead of chrome.pak. |
ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
+ base::FilePath resources_pack_path; |
+ PathService::Get(base::DIR_MODULE, &resources_pack_path); |
+ resources_pack_path = |
+ resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
tfarina
2014/02/26 12:51:44
you can inline this in AddDataPackFromPath call as
blundell
2014/03/03 14:57:51
Done.
|
+ ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
tfarina
2014/02/26 12:51:44
nit: ui::ResourceBundle
blundell
2014/03/03 14:57:51
Done.
|
+ resources_pack_path, ui::SCALE_FACTOR_NONE); |
} |
virtual void Shutdown() OVERRIDE { |