OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_HELPER_H_ | 5 #ifndef UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_ |
6 #define UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_ | 6 #define UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 class MessageLoopForUI; | 12 class MessageLoopForUI; |
13 } | 13 } |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 class ContextFactory; | 16 class ContextFactory; |
| 17 class ContextFactoryPrivate; |
17 } | 18 } |
18 | 19 |
19 namespace views { | 20 namespace views { |
20 | 21 |
21 // A helper class owned by tests that performs platform specific initialization | 22 // A helper class owned by tests that performs platform specific initialization |
22 // required for running tests. | 23 // required for running tests. |
23 class ViewsTestHelper { | 24 class ViewsTestHelper { |
24 public: | 25 public: |
25 ViewsTestHelper(); | 26 ViewsTestHelper(); |
26 virtual ~ViewsTestHelper(); | 27 virtual ~ViewsTestHelper(); |
27 | 28 |
28 // Create a platform specific instance. | 29 // Create a platform specific instance. |
29 static ViewsTestHelper* Create(base::MessageLoopForUI* message_loop, | 30 static ViewsTestHelper* Create( |
30 ui::ContextFactory* context_factory); | 31 base::MessageLoopForUI* message_loop, |
| 32 ui::ContextFactory* context_factory, |
| 33 ui::ContextFactoryPrivate* context_factory_private); |
31 | 34 |
32 // Creates objects that are needed for tests. | 35 // Creates objects that are needed for tests. |
33 virtual void SetUp(); | 36 virtual void SetUp(); |
34 | 37 |
35 // Clean up objects that were created for tests. | 38 // Clean up objects that were created for tests. |
36 virtual void TearDown(); | 39 virtual void TearDown(); |
37 | 40 |
38 // Returns a context view. In aura builds, this will be the | 41 // Returns a context view. In aura builds, this will be the |
39 // RootWindow. Everywhere else, NULL. | 42 // RootWindow. Everywhere else, NULL. |
40 virtual gfx::NativeWindow GetContext(); | 43 virtual gfx::NativeWindow GetContext(); |
41 | 44 |
42 private: | 45 private: |
43 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelper); | 46 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelper); |
44 }; | 47 }; |
45 | 48 |
46 } // namespace views | 49 } // namespace views |
47 | 50 |
48 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_ | 51 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_ |
OLD | NEW |