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