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

Side by Side Diff: ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc

Issue 303723003: Lock Rotation on user settings changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 months 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
OLDNEW
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 Shell::GetInstance()->maximize_mode_controller()-> 111 Shell::GetInstance()->maximize_mode_controller()->
112 EnableMaximizeModeWindowManager(false); 112 EnableMaximizeModeWindowManager(false);
113 } 113 }
114 114
115 // Tests that when the tray view is created, while MaximizeMode is active, and 115 // Tests that when the tray view is created, while MaximizeMode is active, and
116 // rotation is locked, that it is visible. 116 // rotation is locked, that it is visible.
117 TEST_F(TrayRotationLockTest, CreateTrayViewDuringMaximizeModeAndRotationLock) { 117 TEST_F(TrayRotationLockTest, CreateTrayViewDuringMaximizeModeAndRotationLock) {
118 TearDownViews(); 118 TearDownViews();
119 Shell::GetInstance()->maximize_mode_controller()-> 119 Shell::GetInstance()->maximize_mode_controller()->
120 EnableMaximizeModeWindowManager(true); 120 EnableMaximizeModeWindowManager(true);
121 Shell::GetInstance()-> maximize_mode_controller()->set_rotation_locked(true); 121 Shell::GetInstance()-> maximize_mode_controller()->SetRotationLocked(true);
122 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); 122 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget());
123 EXPECT_TRUE(tray_view()->visible()); 123 EXPECT_TRUE(tray_view()->visible());
124 Shell::GetInstance()->maximize_mode_controller()-> 124 Shell::GetInstance()->maximize_mode_controller()->
125 EnableMaximizeModeWindowManager(false); 125 EnableMaximizeModeWindowManager(false);
126 EXPECT_FALSE(tray_view()->visible());
126 } 127 }
127 128
128 // Tests that the enabling of MaximizeMode affects a previously created tray 129 // Tests that the enabling of MaximizeMode affects a previously created tray
129 // view, changing the visibility. 130 // view, changing the visibility.
130 TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringMaximizeMode) { 131 TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringMaximizeMode) {
131 TearDownViews(); 132 ASSERT_FALSE(tray_view()->visible());
132 Shell::GetInstance()->maximize_mode_controller()-> 133 Shell::GetInstance()->maximize_mode_controller()->
133 EnableMaximizeModeWindowManager(true); 134 EnableMaximizeModeWindowManager(true);
134 Shell::GetInstance()-> maximize_mode_controller()->set_rotation_locked(true); 135 Shell::GetInstance()->maximize_mode_controller()->SetRotationLocked(true);
135 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget());
136 EXPECT_TRUE(tray_view()->visible()); 136 EXPECT_TRUE(tray_view()->visible());
137 Shell::GetInstance()->maximize_mode_controller()-> 137 Shell::GetInstance()->maximize_mode_controller()->
138 EnableMaximizeModeWindowManager(false); 138 EnableMaximizeModeWindowManager(false);
139 EXPECT_FALSE(tray_view()->visible()); 139 EXPECT_FALSE(tray_view()->visible());
140 } 140 }
141 141
142 // Tests that the when the tray view is created for a secondary display, that 142 // Tests that the when the tray view is created for a secondary display, that
143 // it is not visible, and that MaximizeMode does not affect visibility. 143 // it is not visible, and that MaximizeMode does not affect visibility.
144 TEST_F(TrayRotationLockTest, CreateSecondaryTrayView) { 144 TEST_F(TrayRotationLockTest, CreateSecondaryTrayView) {
145 if (!SupportsMultipleDisplays()) 145 if (!SupportsMultipleDisplays())
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0.0f, 0.0f), 0); 213 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0.0f, 0.0f), 0);
214 default_view()->OnGestureEvent(&tap); 214 default_view()->OnGestureEvent(&tap);
215 EXPECT_TRUE(maximize_mode_controller->rotation_locked()); 215 EXPECT_TRUE(maximize_mode_controller->rotation_locked());
216 EXPECT_TRUE(tray_view()->visible()); 216 EXPECT_TRUE(tray_view()->visible());
217 217
218 Shell::GetInstance()->maximize_mode_controller()-> 218 Shell::GetInstance()->maximize_mode_controller()->
219 EnableMaximizeModeWindowManager(false); 219 EnableMaximizeModeWindowManager(false);
220 } 220 }
221 221
222 } // namespace ash 222 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/rotation/tray_rotation_lock.cc ('k') | ash/wm/maximize_mode/maximize_mode_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698