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 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // A helper class owned by tests that does common initialization required for | 35 // A helper class owned by tests that does common initialization required for |
36 // Aura use. This class creates a root window with clients and other objects | 36 // Aura use. This class creates a root window with clients and other objects |
37 // that are necessary to run test on Aura. | 37 // that are necessary to run test on Aura. |
38 class AuraTestHelper { | 38 class AuraTestHelper { |
39 public: | 39 public: |
40 explicit AuraTestHelper(base::MessageLoopForUI* message_loop); | 40 explicit AuraTestHelper(base::MessageLoopForUI* message_loop); |
41 ~AuraTestHelper(); | 41 ~AuraTestHelper(); |
42 | 42 |
43 // Creates and initializes (shows and sizes) the RootWindow for use in tests. | 43 // Creates and initializes (shows and sizes) the RootWindow for use in tests. |
44 void SetUp(); | 44 void SetUp(bool allow_test_contexts); |
45 | 45 |
46 // Clean up objects that are created for tests. This also deletes the Env | 46 // Clean up objects that are created for tests. This also deletes the Env |
47 // object. | 47 // object. |
48 void TearDown(); | 48 void TearDown(); |
49 | 49 |
50 // Flushes message loop. | 50 // Flushes message loop. |
51 void RunAllPendingInMessageLoop(); | 51 void RunAllPendingInMessageLoop(); |
52 | 52 |
53 Window* root_window() { return root_window_->window(); } | 53 Window* root_window() { return root_window_->window(); } |
54 RootWindow* dispatcher() { return root_window_.get(); } | 54 RootWindow* dispatcher() { return root_window_.get(); } |
(...skipping 18 matching lines...) Expand all Loading... |
73 scoped_ptr<gfx::SurfaceFactoryOzone> surface_factory_; | 73 scoped_ptr<gfx::SurfaceFactoryOzone> surface_factory_; |
74 #endif | 74 #endif |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); | 76 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace test | 79 } // namespace test |
80 } // namespace aura | 80 } // namespace aura |
81 | 81 |
82 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_ | 82 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_ |
OLD | NEW |