| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/views/test/test_views_delegate.h" | 11 #include "ui/views/test/test_views_delegate.h" |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 #include "ui/base/win/scoped_ole_initializer.h" | 14 #include "ui/base/win/scoped_ole_initializer.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace aura { | 17 namespace aura { |
| 18 class WindowTreeHost; | 18 class WindowTreeHost; |
| 19 namespace test { | |
| 20 class AuraTestHelper; | |
| 21 } | |
| 22 } | 19 } |
| 23 | 20 |
| 24 namespace ui { | 21 namespace ui { |
| 25 class EventProcessor; | 22 class EventProcessor; |
| 26 } | 23 } |
| 27 | 24 |
| 28 namespace wm { | 25 namespace wm { |
| 29 class WMState; | 26 class WMState; |
| 27 class WMTestHelper; |
| 30 } | 28 } |
| 31 | 29 |
| 32 | |
| 33 namespace views { | 30 namespace views { |
| 34 | 31 |
| 35 // A base class for views unit test. It creates a message loop necessary | 32 // A base class for views unit test. It creates a message loop necessary |
| 36 // to drive UI events and takes care of OLE initialization for windows. | 33 // to drive UI events and takes care of OLE initialization for windows. |
| 37 class ViewsTestBase : public testing::Test { | 34 class ViewsTestBase : public testing::Test { |
| 38 public: | 35 public: |
| 39 ViewsTestBase(); | 36 ViewsTestBase(); |
| 40 virtual ~ViewsTestBase(); | 37 virtual ~ViewsTestBase(); |
| 41 | 38 |
| 42 // testing::Test: | 39 // testing::Test: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 61 ui::EventProcessor* event_processor(); | 58 ui::EventProcessor* event_processor(); |
| 62 aura::WindowTreeHost* host(); | 59 aura::WindowTreeHost* host(); |
| 63 | 60 |
| 64 // Returns a context view. In aura builds, this will be the | 61 // Returns a context view. In aura builds, this will be the |
| 65 // RootWindow. Everywhere else, NULL. | 62 // RootWindow. Everywhere else, NULL. |
| 66 gfx::NativeView GetContext(); | 63 gfx::NativeView GetContext(); |
| 67 | 64 |
| 68 private: | 65 private: |
| 69 base::MessageLoopForUI message_loop_; | 66 base::MessageLoopForUI message_loop_; |
| 70 scoped_ptr<TestViewsDelegate> views_delegate_; | 67 scoped_ptr<TestViewsDelegate> views_delegate_; |
| 71 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 68 scoped_ptr<wm::WMTestHelper> wm_test_helper_; |
| 72 scoped_ptr<wm::WMState> wm_state_; | 69 scoped_ptr<wm::WMState> wm_state_; |
| 73 bool setup_called_; | 70 bool setup_called_; |
| 74 bool teardown_called_; | 71 bool teardown_called_; |
| 75 | 72 |
| 76 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
| 77 ui::ScopedOleInitializer ole_initializer_; | 74 ui::ScopedOleInitializer ole_initializer_; |
| 78 #endif | 75 #endif |
| 79 | 76 |
| 80 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase); | 77 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase); |
| 81 }; | 78 }; |
| 82 | 79 |
| 83 } // namespace views | 80 } // namespace views |
| 84 | 81 |
| 85 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ | 82 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ |
| OLD | NEW |