OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 ASH_TEST_ASH_TEST_HELPER_H_ | 5 #ifndef ASH_TEST_ASH_TEST_HELPER_H_ |
6 #define ASH_TEST_ASH_TEST_HELPER_H_ | 6 #define ASH_TEST_ASH_TEST_HELPER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... | |
26 class TestShellDelegate; | 26 class TestShellDelegate; |
27 | 27 |
28 // A helper class that does common initialization required for Ash. Creates a | 28 // A helper class that does common initialization required for Ash. Creates a |
29 // root window and an ash::Shell instance with a test delegate. | 29 // root window and an ash::Shell instance with a test delegate. |
30 class AshTestHelper { | 30 class AshTestHelper { |
31 public: | 31 public: |
32 explicit AshTestHelper(base::MessageLoopForUI* message_loop); | 32 explicit AshTestHelper(base::MessageLoopForUI* message_loop); |
33 ~AshTestHelper(); | 33 ~AshTestHelper(); |
34 | 34 |
35 // Creates the ash::Shell and performs associated initialization. | 35 // Creates the ash::Shell and performs associated initialization. |
36 void SetUp(); | 36 // Set |start_session| to true if the test should run after |
Daniel Erat
2013/08/02 15:40:26
nit: "... if the user should log in before the tes
| |
37 // a user logged in. | |
38 void SetUp(bool start_session); | |
37 | 39 |
38 // Destroys the ash::Shell and performs associated cleanup. | 40 // Destroys the ash::Shell and performs associated cleanup. |
39 void TearDown(); | 41 void TearDown(); |
40 | 42 |
41 // Returns a RootWindow. Usually this is the active RootWindow, but that | 43 // Returns a RootWindow. Usually this is the active RootWindow, but that |
42 // method can return NULL sometimes, and in those cases, we fall back on the | 44 // method can return NULL sometimes, and in those cases, we fall back on the |
43 // primary RootWindow. | 45 // primary RootWindow. |
44 aura::RootWindow* CurrentContext(); | 46 aura::RootWindow* CurrentContext(); |
45 | 47 |
46 void RunAllPendingInMessageLoop(); | 48 void RunAllPendingInMessageLoop(); |
47 | 49 |
48 base::MessageLoopForUI* message_loop() { return message_loop_; } | 50 base::MessageLoopForUI* message_loop() { return message_loop_; } |
49 TestShellDelegate* test_shell_delegate() { return test_shell_delegate_; } | 51 TestShellDelegate* test_shell_delegate() { return test_shell_delegate_; } |
50 | 52 |
51 private: | 53 private: |
52 base::MessageLoopForUI* message_loop_; // Not owned. | 54 base::MessageLoopForUI* message_loop_; // Not owned. |
53 TestShellDelegate* test_shell_delegate_; // Owned by ash::Shell. | 55 TestShellDelegate* test_shell_delegate_; // Owned by ash::Shell. |
54 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; | 56 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; |
55 | 57 |
56 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); | 58 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); |
57 }; | 59 }; |
58 | 60 |
59 } // namespace test | 61 } // namespace test |
60 } // namespace ash | 62 } // namespace ash |
61 | 63 |
62 #endif // ASH_TEST_ASH_TEST_HELPER_H_ | 64 #endif // ASH_TEST_ASH_TEST_HELPER_H_ |
OLD | NEW |