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

Side by Side Diff: ui/views/test/views_test_base.h

Issue 8926004: Revert 114095 - Move the concept of Activation to the Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura_shell/workspace_controller_unittest.cc ('k') | ui/views/test/views_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ 5 #ifndef UI_VIEWS_TEST_VIEWS_TEST_BASE_H_
6 #define UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ 6 #define UI_VIEWS_TEST_VIEWS_TEST_BASE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "ui/views/test/test_views_delegate.h" 12 #include "ui/views/test/test_views_delegate.h"
13 13
14 namespace aura {
15 namespace test {
16 class TestActivationClient;
17 }
18 }
19
20 namespace views { 14 namespace views {
21 15
22 class TestViewsDelegate; 16 class TestViewsDelegate;
23 17
24 // A base class for views unit test. It creates a message loop necessary 18 // A base class for views unit test. It creates a message loop necessary
25 // to drive UI events and takes care of OLE initialization for windows. 19 // to drive UI events and takes care of OLE initialization for windows.
26 class ViewsTestBase : public testing::Test { 20 class ViewsTestBase : public testing::Test {
27 public: 21 public:
28 ViewsTestBase(); 22 ViewsTestBase();
29 virtual ~ViewsTestBase(); 23 virtual ~ViewsTestBase();
30 24
31 // testing::Test: 25 // testing::Test:
32 virtual void SetUp() OVERRIDE; 26 virtual void SetUp() OVERRIDE;
33 virtual void TearDown() OVERRIDE; 27 virtual void TearDown() OVERRIDE;
34 28
35 void RunPendingMessages(); 29 void RunPendingMessages();
36 30
37 protected: 31 protected:
38 TestViewsDelegate& views_delegate() const { return *views_delegate_.get(); } 32 TestViewsDelegate& views_delegate() const { return *views_delegate_.get(); }
39 33
40 void set_views_delegate(TestViewsDelegate* views_delegate) { 34 void set_views_delegate(TestViewsDelegate* views_delegate) {
41 views_delegate_.reset(views_delegate); 35 views_delegate_.reset(views_delegate);
42 } 36 }
43 37
44 MessageLoop* message_loop() { return &message_loop_; } 38 MessageLoop* message_loop() { return &message_loop_; }
45 39
46 private: 40 private:
47 MessageLoopForUI message_loop_; 41 MessageLoopForUI message_loop_;
48 scoped_ptr<TestViewsDelegate> views_delegate_; 42 scoped_ptr<TestViewsDelegate> views_delegate_;
49 #if defined(USE_AURA)
50 scoped_ptr<aura::test::TestActivationClient> test_activation_client_;
51 #endif
52 bool setup_called_; 43 bool setup_called_;
53 bool teardown_called_; 44 bool teardown_called_;
54 45
55 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase); 46 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase);
56 }; 47 };
57 48
58 } // namespace views 49 } // namespace views
59 50
60 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ 51 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_
OLDNEW
« no previous file with comments | « ui/aura_shell/workspace_controller_unittest.cc ('k') | ui/views/test/views_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698