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_BASE_H_ | 5 #ifndef UI_AURA_TEST_AURA_TEST_BASE_H_ |
6 #define UI_AURA_TEST_AURA_TEST_BASE_H_ | 6 #define UI_AURA_TEST_AURA_TEST_BASE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/aura/test/aura_test_helper.h" | 12 #include "ui/aura/test/aura_test_helper.h" |
13 | 13 |
14 namespace aura { | 14 namespace aura { |
15 class RootWindow; | 15 class RootWindow; |
| 16 class Window; |
16 namespace test { | 17 namespace test { |
17 | 18 |
18 // A base class for aura unit tests. | 19 // A base class for aura unit tests. |
19 // TODO(beng): Instances of this test will create and own a RootWindow. | 20 // TODO(beng): Instances of this test will create and own a RootWindow. |
20 class AuraTestBase : public testing::Test { | 21 class AuraTestBase : public testing::Test { |
21 public: | 22 public: |
22 AuraTestBase(); | 23 AuraTestBase(); |
23 virtual ~AuraTestBase(); | 24 virtual ~AuraTestBase(); |
24 | 25 |
25 // testing::Test: | 26 // testing::Test: |
26 virtual void SetUp() OVERRIDE; | 27 virtual void SetUp() OVERRIDE; |
27 virtual void TearDown() OVERRIDE; | 28 virtual void TearDown() OVERRIDE; |
28 | 29 |
| 30 // Creates a transient window that is transient to |parent|. |
| 31 aura::Window* CreateTransientChild(int id, aura::Window* parent); |
| 32 |
| 33 // Attach |window| to the current shell's root window. |
| 34 void SetDefaultParentByPrimaryRootWindow(aura::Window* window); |
| 35 |
29 protected: | 36 protected: |
30 void RunAllPendingInMessageLoop(); | 37 void RunAllPendingInMessageLoop(); |
31 | 38 |
32 RootWindow* root_window() { return helper_->root_window(); } | 39 RootWindow* root_window() { return helper_->root_window(); } |
33 | 40 |
34 private: | 41 private: |
35 MessageLoopForUI message_loop_; | 42 MessageLoopForUI message_loop_; |
36 scoped_ptr<AuraTestHelper> helper_; | 43 scoped_ptr<AuraTestHelper> helper_; |
37 | 44 |
38 DISALLOW_COPY_AND_ASSIGN(AuraTestBase); | 45 DISALLOW_COPY_AND_ASSIGN(AuraTestBase); |
39 }; | 46 }; |
40 | 47 |
41 } // namespace test | 48 } // namespace test |
42 } // namespace aura | 49 } // namespace aura |
43 | 50 |
44 #endif // UI_AURA_TEST_AURA_TEST_BASE_H_ | 51 #endif // UI_AURA_TEST_AURA_TEST_BASE_H_ |
OLD | NEW |