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

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

Issue 2773013003: Remember User locked rotation (Closed)
Patch Set: . Created 3 years, 9 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
« no previous file with comments | « ash/display/screen_orientation_controller_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 7 #include <memory>
8 8
9 #include "ash/common/system/status_area_widget.h" 9 #include "ash/common/system/status_area_widget.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray())); 245 StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray()));
246 246
247 display::Display::SetInternalDisplayId(internal_display_id); 247 display::Display::SetInternalDisplayId(internal_display_id);
248 std::unique_ptr<views::View> tray_view(CreateTrayView(tray.get())); 248 std::unique_ptr<views::View> tray_view(CreateTrayView(tray.get()));
249 std::unique_ptr<views::View> default_view(tray->CreateDefaultView( 249 std::unique_ptr<views::View> default_view(tray->CreateDefaultView(
250 StatusAreaWidgetTestHelper::GetUserLoginStatus())); 250 StatusAreaWidgetTestHelper::GetUserLoginStatus()));
251 EXPECT_TRUE(default_view); 251 EXPECT_TRUE(default_view);
252 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 252 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
253 true); 253 true);
254 EXPECT_TRUE(default_view->visible()); 254 EXPECT_TRUE(default_view->visible());
255 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
256 false);
255 } 257 }
256 258
257 // Tests that when the tray view is deleted, while TrayRotationLock has not been 259 // Tests that when the tray view is deleted, while TrayRotationLock has not been
258 // deleted, that updates to the rotation lock state do not crash. 260 // deleted, that updates to the rotation lock state do not crash.
259 TEST_F(TrayRotationLockTest, LockUpdatedDuringDesctruction) { 261 TEST_F(TrayRotationLockTest, LockUpdatedDuringDesctruction) {
260 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 262 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
261 true); 263 true);
262 DestroyTrayView(); 264 DestroyTrayView();
263 Shell::GetInstance() 265 Shell::GetInstance()
264 ->screen_orientation_controller() 266 ->screen_orientation_controller()
265 ->ToggleUserRotationLock(); 267 ->ToggleUserRotationLock();
266 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 268 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
267 false); 269 false);
268 } 270 }
269 271
270 } // namespace ash 272 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/screen_orientation_controller_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698