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

Unified Diff: components/test/run_all_unittests.cc

Issue 172473002: Move many of the Autofill unittests into components_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Load pakfile from same path on all platforms Created 6 years, 10 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
« components/components_tests.gyp ('K') | « components/test/DEPS ('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 b59285f597fd488200c4dab4e10468d84d4c4e59..3c696ff83acb194f69a81a68d4d4829e65e7783e 100644
--- a/components/test/run_all_unittests.cc
+++ b/components/test/run_all_unittests.cc
@@ -4,18 +4,29 @@
#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 "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_paths.h"
#include "content/public/test/test_content_client_initializer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/resource/resource_bundle.h"
+#if defined(OS_MACOSX)
+#include "base/mac/bundle_locations.h"
+#endif
+
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "ui/base/android/ui_base_jni_registrar.h"
#include "ui/gfx/android/gfx_jni_registrar.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "chromeos/chromeos_paths.h"
+#endif
+
namespace {
class ComponentsTestSuite : public base::TestSuite {
@@ -33,9 +44,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);
+ path = path.Append(chrome::kFrameworkName);
+ base::mac::SetOverrideFrameworkBundlePath(path);
+#endif
+
+ chrome::RegisterPathProvider();
+#if defined(OS_CHROMEOS)
+ chromeos::RegisterPathProvider();
+#endif
// 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"));
+ ResourceBundle::GetSharedInstance().AddDataPackFromPath(
+ resources_pack_path, ui::SCALE_FACTOR_NONE);
}
virtual void Shutdown() OVERRIDE {
« components/components_tests.gyp ('K') | « components/test/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698