| 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/at_exit.h" |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/views/test/test_views_delegate.h" | 12 #include "ui/views/test/test_views_delegate.h" |
| 12 | 13 |
| 13 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 14 #include "ui/base/win/scoped_ole_initializer.h" | 15 #include "ui/base/win/scoped_ole_initializer.h" |
| 15 #endif | 16 #endif |
| 16 | 17 |
| 17 namespace views { | 18 namespace views { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 views_delegate_.reset(views_delegate); | 43 views_delegate_.reset(views_delegate); |
| 43 } | 44 } |
| 44 | 45 |
| 45 base::MessageLoopForUI* message_loop() { return &message_loop_; } | 46 base::MessageLoopForUI* message_loop() { return &message_loop_; } |
| 46 | 47 |
| 47 // Returns a context view. In aura builds, this will be the | 48 // Returns a context view. In aura builds, this will be the |
| 48 // RootWindow. Everywhere else, NULL. | 49 // RootWindow. Everywhere else, NULL. |
| 49 gfx::NativeView GetContext(); | 50 gfx::NativeView GetContext(); |
| 50 | 51 |
| 51 private: | 52 private: |
| 53 base::ShadowingAtExitManager at_exit_; |
| 52 base::MessageLoopForUI message_loop_; | 54 base::MessageLoopForUI message_loop_; |
| 53 scoped_ptr<TestViewsDelegate> views_delegate_; | 55 scoped_ptr<TestViewsDelegate> views_delegate_; |
| 54 scoped_ptr<ViewsTestHelper> test_helper_; | 56 scoped_ptr<ViewsTestHelper> test_helper_; |
| 55 bool setup_called_; | 57 bool setup_called_; |
| 56 bool teardown_called_; | 58 bool teardown_called_; |
| 57 | 59 |
| 58 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
| 59 ui::ScopedOleInitializer ole_initializer_; | 61 ui::ScopedOleInitializer ole_initializer_; |
| 60 #endif | 62 #endif |
| 61 | 63 |
| 62 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase); | 64 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase); |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 } // namespace views | 67 } // namespace views |
| 66 | 68 |
| 67 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ | 69 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ |
| OLD | NEW |