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

Unified Diff: views/test/views_test_base.h

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/focus/focus_manager_unittest.cc ('k') | views/test/views_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/test/views_test_base.h
diff --git a/views/test/views_test_base.h b/views/test/views_test_base.h
index 4eb111ac4ae767453700821fbff45e4f8feba7b0..0d27c3f7c45e93674971f11f5c997813374085fc 100644
--- a/views/test/views_test_base.h
+++ b/views/test/views_test_base.h
@@ -9,10 +9,13 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "base/message_loop.h"
+#include "base/scoped_ptr.h"
#include "views/test/test_views_delegate.h"
namespace views {
+class TestViewsDelegate;
+
// A base class for views unit test. It creates a message loop necessary
// to drive UI events and takes care of OLE initialization for windows.
class ViewsTestBase : public testing::Test {
@@ -21,18 +24,25 @@ class ViewsTestBase : public testing::Test {
virtual ~ViewsTestBase();
// testing::Test:
- virtual void TearDown();
+ virtual void SetUp() OVERRIDE;
+ virtual void TearDown() OVERRIDE;
void RunPendingMessages() {
message_loop_.RunAllPending();
}
protected:
- TestViewsDelegate& views_delegate() { return views_delegate_; }
+ TestViewsDelegate& views_delegate() const { return *views_delegate_.get(); }
+
+ void set_views_delegate(TestViewsDelegate* views_delegate) {
+ views_delegate_.reset(views_delegate);
+ }
private:
MessageLoopForUI message_loop_;
- TestViewsDelegate views_delegate_;
+ scoped_ptr<TestViewsDelegate> views_delegate_;
+ bool setup_called_;
+ bool teardown_called_;
DISALLOW_COPY_AND_ASSIGN(ViewsTestBase);
};
« no previous file with comments | « views/focus/focus_manager_unittest.cc ('k') | views/test/views_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698