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

Unified Diff: components/test/run_all_unittests.cc

Issue 11830043: Move content/components/navigation_interception to src/components (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 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/test/DEPS ('k') | content/components/DEPS » ('j') | 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 2c8d29c6d00885e8e8c27f74a105e94cb5c96fa4..49032baee6411b2c512362f8b0039e6fa14c4cfc 100644
--- a/components/test/run_all_unittests.cc
+++ b/components/test/run_all_unittests.cc
@@ -2,8 +2,46 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/memory/scoped_ptr.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/compositor/compositor_setup.h"
+
+namespace components {
+
+class ComponentsUnitTestEventListener : public testing::EmptyTestEventListener {
+ public:
+ ComponentsUnitTestEventListener() {}
+ virtual ~ComponentsUnitTestEventListener() {}
+
+ virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE {
+ content_initializer_.reset(new content::TestContentClientInitializer());
+ }
+
+ virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE {
+ content_initializer_.reset();
+ }
+
+ private:
+ scoped_ptr<content::TestContentClientInitializer> content_initializer_;
+
+ DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener);
+};
+
+} // namespace components
int main(int argc, char** argv) {
- return base::TestSuite(argc, argv).Run();
+ base::TestSuite test_suite(argc, argv);
+
+ // Mock out the compositor on platforms that use it.
+ ui::SetupTestCompositor();
+
+ // 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());
+
+ return test_suite.Run();
}
« no previous file with comments | « components/test/DEPS ('k') | content/components/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698