OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ATHENA_TEST_BASE_ATHENA_TEST_HELPER_H_ | |
6 #define ATHENA_TEST_BASE_ATHENA_TEST_HELPER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "ui/aura/window_tree_host.h" | |
11 | |
12 namespace base { | |
13 class MessageLoopForUI; | |
14 class Thread; | |
15 } | |
16 | |
17 namespace ui { | |
18 class ContextFactory; | |
19 class ScopedAnimationDurationScaleMode; | |
20 } | |
21 | |
22 namespace aura { | |
23 class Window; | |
24 class TestScreen; | |
25 class WindowTreeHost; | |
26 namespace client { | |
27 class FocusClient; | |
28 } | |
29 } | |
30 | |
31 namespace wm { | |
32 class InputMethodEventFilter; | |
33 } | |
34 | |
35 namespace athena { | |
36 namespace test { | |
37 | |
38 // A helper class owned by tests that does common initialization required for | |
39 // Athena use. This class creates a root window with clients and other objects | |
40 // that are necessary to run test on Athena. | |
41 class AthenaTestHelper { | |
42 public: | |
43 explicit AthenaTestHelper(base::MessageLoopForUI* message_loop); | |
44 ~AthenaTestHelper(); | |
45 | |
46 // Creates and initializes (shows and sizes) the RootWindow for use in tests. | |
47 void SetUp(ui::ContextFactory* context_factory); | |
48 | |
49 // Clean up objects that are created for tests. This also deletes the Env | |
50 // object. | |
51 void TearDown(); | |
52 | |
53 // Flushes message loop. | |
54 void RunAllPendingInMessageLoop(); | |
55 | |
56 aura::Window* GetRootWindow(); | |
57 aura::WindowTreeHost* GetHost(); | |
58 | |
59 private: | |
60 bool setup_called_; | |
61 bool teardown_called_; | |
62 | |
63 base::MessageLoopForUI* message_loop_; | |
64 | |
65 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; | |
66 scoped_ptr<base::Thread> file_thread_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(AthenaTestHelper); | |
69 }; | |
70 | |
71 } // namespace test | |
72 } // namespace athena | |
73 | |
74 #endif // ATHENA_TEST_BASE_ATHENA_TEST_HELPER_H_ | |
OLD | NEW |