OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" | 5 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); | 108 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); |
109 EXPECT_FALSE(tray_view()->visible()); | 109 EXPECT_FALSE(tray_view()->visible()); |
110 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); | 110 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); |
111 } | 111 } |
112 | 112 |
113 // Tests that when the tray view is created, while MaximizeMode is active, and | 113 // Tests that when the tray view is created, while MaximizeMode is active, and |
114 // rotation is locked, that it is visible. | 114 // rotation is locked, that it is visible. |
115 TEST_F(TrayRotationLockTest, CreateTrayViewDuringMaximizeModeAndRotationLock) { | 115 TEST_F(TrayRotationLockTest, CreateTrayViewDuringMaximizeModeAndRotationLock) { |
116 TearDownViews(); | 116 TearDownViews(); |
117 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); | 117 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); |
118 Shell::GetInstance()-> maximize_mode_controller()->set_rotation_locked(true); | 118 Shell::GetInstance()-> maximize_mode_controller()->SetRotationLocked(true); |
119 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); | 119 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); |
120 EXPECT_TRUE(tray_view()->visible()); | 120 EXPECT_TRUE(tray_view()->visible()); |
121 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); | 121 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); |
122 } | 122 } |
123 | 123 |
124 // Tests that the enabling of MaximizeMode affects a previously created tray | 124 // Tests that the enabling of MaximizeMode affects a previously created tray |
125 // view, changing the visibility. | 125 // view, changing the visibility. |
126 TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringMaximizeMode) { | 126 TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringMaximizeMode) { |
127 TearDownViews(); | 127 TearDownViews(); |
128 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); | 128 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); |
129 Shell::GetInstance()-> maximize_mode_controller()->set_rotation_locked(true); | 129 Shell::GetInstance()-> maximize_mode_controller()->SetRotationLocked(true); |
130 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); | 130 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); |
131 EXPECT_TRUE(tray_view()->visible()); | 131 EXPECT_TRUE(tray_view()->visible()); |
132 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); | 132 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); |
133 EXPECT_FALSE(tray_view()->visible()); | 133 EXPECT_FALSE(tray_view()->visible()); |
134 } | 134 } |
135 | 135 |
136 // Tests that the when the tray view is created for a secondary display, that | 136 // Tests that the when the tray view is created for a secondary display, that |
137 // it is not visible, and that MaximizeMode does not affect visibility. | 137 // it is not visible, and that MaximizeMode does not affect visibility. |
138 TEST_F(TrayRotationLockTest, CreateSecondaryTrayView) { | 138 TEST_F(TrayRotationLockTest, CreateSecondaryTrayView) { |
139 if (!SupportsMultipleDisplays()) | 139 if (!SupportsMultipleDisplays()) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 ui::GestureEvent tap(ui::ET_GESTURE_TAP, 0, 0, 0, base::TimeDelta(), | 199 ui::GestureEvent tap(ui::ET_GESTURE_TAP, 0, 0, 0, base::TimeDelta(), |
200 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0.0f, 0.0f), 0); | 200 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0.0f, 0.0f), 0); |
201 default_view()->OnGestureEvent(&tap); | 201 default_view()->OnGestureEvent(&tap); |
202 EXPECT_TRUE(maximize_mode_controller->rotation_locked()); | 202 EXPECT_TRUE(maximize_mode_controller->rotation_locked()); |
203 EXPECT_TRUE(tray_view()->visible()); | 203 EXPECT_TRUE(tray_view()->visible()); |
204 | 204 |
205 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); | 205 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); |
206 } | 206 } |
207 | 207 |
208 } // namespace ash | 208 } // namespace ash |
OLD | NEW |