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

Unified Diff: components/test/run_all_unittests.cc

Issue 82353002: Move more webdata unittests into components_unittests target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac link issue? Created 7 years, 1 month 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/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 a509a8236971222d4a851b8e64e2dfeefcb85871..132291b34d1122758869b79e83d698ab63b78320 100644
--- a/components/test/run_all_unittests.cc
+++ b/components/test/run_all_unittests.cc
@@ -4,12 +4,14 @@
#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"
-namespace components {
+namespace {
class ComponentsUnitTestEventListener : public testing::EmptyTestEventListener {
public:
@@ -30,18 +32,52 @@ class ComponentsUnitTestEventListener : public testing::EmptyTestEventListener {
DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener);
};
-} // namespace components
+class ComponentsTestSuite : public base::TestSuite {
+ public:
+ ComponentsTestSuite(int argc, char** argv);
+
+ private:
+ virtual void Initialize() OVERRIDE;
+ virtual void Shutdown() OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(ComponentsTestSuite);
+};
+
+ComponentsTestSuite::ComponentsTestSuite(int argc, char** argv)
+ : TestSuite(argc, argv) {}
+
+void ComponentsTestSuite::Initialize() {
+ base::TestSuite::Initialize();
+
+ base::FilePath pak_dir;
+ PathService::Get(base::DIR_MODULE, &pak_dir);
+
+ base::FilePath pak_file;
+ pak_file = pak_dir.AppendASCII("components")
+ .AppendASCII("paks")
+ .AppendASCII("components_test.pak");
+
+ ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
Peter Beverloo 2013/11/27 19:00:20 ui::ResourceBundle requires screen information, wh
+}
+
+void ComponentsTestSuite::Shutdown() {
+ ui::ResourceBundle::CleanupSharedInstance();
+ base::TestSuite::Shutdown();
+}
+
+} // namespace
int main(int argc, char** argv) {
- base::TestSuite test_suite(argc, argv);
+ ComponentsTestSuite test_suite(argc, argv);
// The listener will set up common test environment for all components unit
// tests.
testing::TestEventListeners& listeners =
testing::UnitTest::GetInstance()->listeners();
- listeners.Append(new components::ComponentsUnitTestEventListener());
+ listeners.Append(new ComponentsUnitTestEventListener());
return base::LaunchUnitTests(
- argc, argv, base::Bind(&base::TestSuite::Run,
- base::Unretained(&test_suite)));
+ argc,
+ argv,
+ base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
}
« no previous file with comments | « components/test/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698