| 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 <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 Loading... |
| 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 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 252 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 253 true); | 253 true); |
| 254 EXPECT_TRUE(default_view->visible()); | 254 EXPECT_TRUE(default_view->visible()); |
| 255 WmShell::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 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 262 WmShell::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 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 268 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 267 false); | 269 false); |
| 268 } | 270 } |
| 269 | 271 |
| 270 } // namespace ash | 272 } // namespace ash |
| OLD | NEW |