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_AURA_TEST_AURA_TEST_HELPER_H_ | 5 #ifndef UI_AURA_TEST_AURA_TEST_HELPER_H_ |
6 #define UI_AURA_TEST_AURA_TEST_HELPER_H_ | 6 #define UI_AURA_TEST_AURA_TEST_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 | 11 |
| 12 #if defined(OS_WIN) |
| 13 #include "ui/base/win/scoped_ole_initializer.h" |
| 14 #endif |
| 15 |
12 namespace aura { | 16 namespace aura { |
13 class RootWindow; | 17 class RootWindow; |
14 namespace test { | 18 namespace test { |
15 | 19 |
16 // A helper class owned by tests that does common initialization required for | 20 // A helper class owned by tests that does common initialization required for |
17 // Aura use. This class must create no special environment (e.g. no RootWindow) | 21 // Aura use. This class must create no special environment (e.g. no RootWindow) |
18 // since different users will want their own specific environments and will | 22 // since different users will want their own specific environments and will |
19 // set that up themselves. | 23 // set that up themselves. |
20 class AuraTestHelper { | 24 class AuraTestHelper { |
21 public: | 25 public: |
22 AuraTestHelper(); | 26 AuraTestHelper(); |
23 virtual ~AuraTestHelper(); | 27 virtual ~AuraTestHelper(); |
24 | 28 |
25 // Initializes (shows and sizes) the provided RootWindow for use in tests. | 29 // Initializes (shows and sizes) the provided RootWindow for use in tests. |
26 void InitRootWindow(RootWindow* root_window); | 30 void InitRootWindow(RootWindow* root_window); |
27 | 31 |
28 void SetUp(); | 32 void SetUp(); |
29 void TearDown(); | 33 void TearDown(); |
30 | 34 |
31 // Flushes message loop. | 35 // Flushes message loop. |
32 void RunAllPendingInMessageLoop(RootWindow* root_window); | 36 void RunAllPendingInMessageLoop(RootWindow* root_window); |
33 | 37 |
34 private: | 38 private: |
35 MessageLoopForUI message_loop_; | 39 MessageLoopForUI message_loop_; |
36 bool setup_called_; | 40 bool setup_called_; |
37 bool teardown_called_; | 41 bool teardown_called_; |
38 | 42 |
| 43 #if defined(OS_WIN) |
| 44 ui::ScopedOleInitializer ole_initializer_; |
| 45 #endif |
| 46 |
39 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); | 47 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); |
40 }; | 48 }; |
41 | 49 |
42 } // namespace test | 50 } // namespace test |
43 } // namespace aura | 51 } // namespace aura |
44 | 52 |
45 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_ | 53 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_ |
OLD | NEW |