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

Unified Diff: views/test/views_test_base.cc

Issue 7720020: Get views_unittests pass on touch build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: enable TouchSelectionControllerImplTest as they're fixed Created 9 years, 4 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 | « views/test/views_test_base.h ('k') | views/touchui/touch_selection_controller_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/test/views_test_base.cc
diff --git a/views/test/views_test_base.cc b/views/test/views_test_base.cc
index c78bf2719f432cd9b19c4d4bd6b6490b83a8822f..33a3c476187b2320aee6774c81aec5869fbbad81 100644
--- a/views/test/views_test_base.cc
+++ b/views/test/views_test_base.cc
@@ -10,7 +10,9 @@
namespace views {
-ViewsTestBase::ViewsTestBase() {
+ViewsTestBase::ViewsTestBase()
+ : setup_called_(false),
+ teardown_called_(false) {
#if defined(OS_WIN)
OleInitialize(NULL);
#endif
@@ -20,12 +22,26 @@ ViewsTestBase::~ViewsTestBase() {
#if defined(OS_WIN)
OleUninitialize();
#endif
+ CHECK(setup_called_)
+ << "You have overridden SetUp but never called super class's SetUp";
+ CHECK(teardown_called_)
+ << "You have overrideen TearDown but never called super class's TearDown";
+}
+
+void ViewsTestBase::SetUp() {
+ testing::Test::SetUp();
+ setup_called_ = true;
+ if (!views_delegate_.get())
+ views_delegate_.reset(new TestViewsDelegate());
}
void ViewsTestBase::TearDown() {
// Flush the message loop because we have pending release tasks
// and these tasks if un-executed would upset Valgrind.
RunPendingMessages();
+ teardown_called_ = true;
+ views_delegate_.reset();
+ testing::Test::TearDown();
}
} // namespace views
« no previous file with comments | « views/test/views_test_base.h ('k') | views/touchui/touch_selection_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698