Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: ash/test/ash_test_helper.h

Issue 2493923002: Select-to-speak event handler (Closed)
Patch Set: Fix presubmit warning Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/test/ash_test_environment_default.cc ('k') | ash/test/ash_test_views_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 8 #include <memory>
9 9
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
11 #include "ash/common/test/material_design_controller_test_api.h" 11 #include "ash/common/test/material_design_controller_test_api.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 14
15 namespace aura { 15 namespace aura {
16 class Window; 16 class Window;
17 } // namespace aura 17 } // namespace aura
18 18
19 namespace ui { 19 namespace ui {
20 class ScopedAnimationDurationScaleMode; 20 class ScopedAnimationDurationScaleMode;
21 } // namespace ui 21 } // namespace ui
22 22
23 namespace views {
24 class ViewsDelegate;
25 }
26
27 namespace wm { 23 namespace wm {
28 class WMState; 24 class WMState;
29 } 25 }
30 26
31 namespace ash { 27 namespace ash {
32 namespace test { 28 namespace test {
33 29
34 class AshTestEnvironment; 30 class AshTestEnvironment;
31 class AshTestViewsDelegate;
35 class TestScreenshotDelegate; 32 class TestScreenshotDelegate;
36 class TestShellDelegate; 33 class TestShellDelegate;
37 class TestSessionStateDelegate; 34 class TestSessionStateDelegate;
38 35
39 // A helper class that does common initialization required for Ash. Creates a 36 // A helper class that does common initialization required for Ash. Creates a
40 // root window and an ash::Shell instance with a test delegate. 37 // root window and an ash::Shell instance with a test delegate.
41 class AshTestHelper { 38 class AshTestHelper {
42 public: 39 public:
43 explicit AshTestHelper(AshTestEnvironment* ash_test_environment); 40 explicit AshTestHelper(AshTestEnvironment* ash_test_environment);
44 ~AshTestHelper(); 41 ~AshTestHelper();
(...skipping 17 matching lines...) Expand all
62 59
63 static TestSessionStateDelegate* GetTestSessionStateDelegate(); 60 static TestSessionStateDelegate* GetTestSessionStateDelegate();
64 61
65 TestShellDelegate* test_shell_delegate() { return test_shell_delegate_; } 62 TestShellDelegate* test_shell_delegate() { return test_shell_delegate_; }
66 void set_test_shell_delegate(TestShellDelegate* test_shell_delegate) { 63 void set_test_shell_delegate(TestShellDelegate* test_shell_delegate) {
67 test_shell_delegate_ = test_shell_delegate; 64 test_shell_delegate_ = test_shell_delegate;
68 } 65 }
69 TestScreenshotDelegate* test_screenshot_delegate() { 66 TestScreenshotDelegate* test_screenshot_delegate() {
70 return test_screenshot_delegate_; 67 return test_screenshot_delegate_;
71 } 68 }
69 AshTestViewsDelegate* views_delegate() { return views_delegate_.get(); }
72 70
73 AshTestEnvironment* ash_test_environment() { return ash_test_environment_; } 71 AshTestEnvironment* ash_test_environment() { return ash_test_environment_; }
74 72
75 // True if the running environment supports multiple displays, 73 // True if the running environment supports multiple displays,
76 // or false otherwise (e.g. win8 bot). 74 // or false otherwise (e.g. win8 bot).
77 static bool SupportsMultipleDisplays(); 75 static bool SupportsMultipleDisplays();
78 76
79 private: 77 private:
80 AshTestEnvironment* ash_test_environment_; // Not owned. 78 AshTestEnvironment* ash_test_environment_; // Not owned.
81 TestShellDelegate* test_shell_delegate_; // Owned by ash::Shell. 79 TestShellDelegate* test_shell_delegate_; // Owned by ash::Shell.
82 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; 80 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
83 81
84 // Owned by ash::AcceleratorController 82 // Owned by ash::AcceleratorController
85 TestScreenshotDelegate* test_screenshot_delegate_; 83 TestScreenshotDelegate* test_screenshot_delegate_;
86 84
87 std::unique_ptr<::wm::WMState> wm_state_; 85 std::unique_ptr<::wm::WMState> wm_state_;
88 std::unique_ptr<views::ViewsDelegate> views_delegate_; 86 std::unique_ptr<AshTestViewsDelegate> views_delegate_;
89 87
90 #if defined(OS_CHROMEOS) 88 #if defined(OS_CHROMEOS)
91 // Check if DBus Thread Manager was initialized here. 89 // Check if DBus Thread Manager was initialized here.
92 bool dbus_thread_manager_initialized_; 90 bool dbus_thread_manager_initialized_;
93 // Check if Bluez DBus Manager was initialized here. 91 // Check if Bluez DBus Manager was initialized here.
94 bool bluez_dbus_manager_initialized_; 92 bool bluez_dbus_manager_initialized_;
95 #endif 93 #endif
96 94
97 std::unique_ptr<test::MaterialDesignControllerTestAPI> material_design_state_; 95 std::unique_ptr<test::MaterialDesignControllerTestAPI> material_design_state_;
98 96
99 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); 97 DISALLOW_COPY_AND_ASSIGN(AshTestHelper);
100 }; 98 };
101 99
102 } // namespace test 100 } // namespace test
103 } // namespace ash 101 } // namespace ash
104 102
105 #endif // ASH_TEST_ASH_TEST_HELPER_H_ 103 #endif // ASH_TEST_ASH_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « ash/test/ash_test_environment_default.cc ('k') | ash/test/ash_test_views_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698