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