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

Unified Diff: components/test/run_all_unittests.cc

Issue 856163002: Eliminate components_unittests' dependence on chrome resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years, 11 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 | « components/components_unittests.isolate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test/run_all_unittests.cc
diff --git a/components/test/run_all_unittests.cc b/components/test/run_all_unittests.cc
index 533ac9d917c8c7cf62685f813807f114d1cf9bc7..00d8594a1ce897a6c6c2eb87d2937fc80c3d2b85 100644
--- a/components/test/run_all_unittests.cc
+++ b/components/test/run_all_unittests.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/bind.h"
+#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/statistics_recorder.h"
#include "base/path_service.h"
@@ -15,10 +16,6 @@
#include "ui/base/ui_base_paths.h"
#include "url/url_util.h"
-#if defined(OS_MACOSX)
-#include "base/mac/bundle_locations.h"
-#endif
-
#if !defined(OS_IOS)
#include "ui/gl/gl_surface.h"
#endif
@@ -56,41 +53,16 @@ class ComponentsTestSuite : public base::TestSuite {
invalidation::android::RegisterInvalidationJni(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);
-
- // TODO(tfarina): This is temporary. The right fix is to write a
- // framework-Info.plist and integrate that into the build.
- // Hardcode the framework name here to avoid having to depend on chrome's
- // common target for chrome::kFrameworkName.
-#if defined(GOOGLE_CHROME_BUILD)
- path = path.AppendASCII("Google Chrome Framework.framework");
-#elif defined(CHROMIUM_BUILD)
- path = path.AppendASCII("Chromium Framework.framework");
-#else
-#error Unknown branding
-#endif
-
- 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. crbug.com/348563
- ui::ResourceBundle::InitSharedInstanceWithLocale(
- "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
base::FilePath resources_pack_path;
-#if !defined(OS_ANDROID)
- PathService::Get(base::DIR_MODULE, &resources_pack_path);
-#else
+#if defined(OS_ANDROID)
PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &resources_pack_path);
+#else
+ PathService::Get(base::DIR_MODULE, &resources_pack_path);
#endif
- ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
- resources_pack_path.AppendASCII("resources.pak"),
- ui::SCALE_FACTOR_NONE);
+ ui::ResourceBundle::InitSharedInstanceWithPakPath(
+ resources_pack_path.AppendASCII("components_unittests_resources.pak"));
// These schemes need to be added globally to pass tests of
// autocomplete_input_unittest.cc and content_settings_pattern*
@@ -107,10 +79,6 @@ class ComponentsTestSuite : public base::TestSuite {
void Shutdown() override {
ui::ResourceBundle::CleanupSharedInstance();
-#if defined(OS_MACOSX) && !defined(OS_IOS)
- base::mac::SetOverrideFrameworkBundle(NULL);
-#endif
-
base::TestSuite::Shutdown();
}
« no previous file with comments | « components/components_unittests.isolate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698