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

Unified Diff: ui/views/test/views_test_base.h

Issue 1175783003: Split out Ash dependency in app info dialog unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ViewEventTestBase will not play nice Created 5 years, 6 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
Index: ui/views/test/views_test_base.h
diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h
index 17352ebf5d041f3a1c977278894d43acd9f9abb7..b59ebf48649c4c159ef57869de0347da98f710ec 100644
--- a/ui/views/test/views_test_base.h
+++ b/ui/views/test/views_test_base.h
@@ -9,6 +9,7 @@
#include "base/message_loop/message_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+#include "ui/views/test/scoped_views_test_helper.h"
#include "ui/views/test/test_views_delegate.h"
#include "ui/views/widget/widget.h"
@@ -18,8 +19,6 @@
namespace views {
-class ViewsTestHelper;
-
// 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 PlatformTest {
@@ -38,10 +37,13 @@ class ViewsTestBase : public PlatformTest {
Widget::InitParams CreateParams(Widget::InitParams::Type type);
protected:
- TestViewsDelegate* views_delegate() const { return views_delegate_.get(); }
+ TestViewsDelegate* views_delegate() const {
+ return test_helper_->views_delegate();
+ }
void set_views_delegate(scoped_ptr<TestViewsDelegate> views_delegate) {
- views_delegate_.swap(views_delegate);
+ DCHECK(!setup_called_);
+ views_delegate_for_setup_.swap(views_delegate);
}
base::MessageLoopForUI* message_loop() { return &message_loop_; }
@@ -52,8 +54,8 @@ class ViewsTestBase : public PlatformTest {
private:
base::MessageLoopForUI message_loop_;
- scoped_ptr<TestViewsDelegate> views_delegate_;
- scoped_ptr<ViewsTestHelper> test_helper_;
+ scoped_ptr<TestViewsDelegate> views_delegate_for_setup_;
+ scoped_ptr<ScopedViewsTestHelper> test_helper_;
bool setup_called_;
bool teardown_called_;

Powered by Google App Engine
This is Rietveld 408576698