| 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/display/screen_orientation_controller_chromeos.h" | 9 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 default_view()->OnGestureEvent(&tap); | 236 default_view()->OnGestureEvent(&tap); |
| 237 EXPECT_TRUE(screen_orientation_controller->rotation_locked()); | 237 EXPECT_TRUE(screen_orientation_controller->rotation_locked()); |
| 238 EXPECT_TRUE(tray_view()->visible()); | 238 EXPECT_TRUE(tray_view()->visible()); |
| 239 | 239 |
| 240 maximize_mode_controller->EnableMaximizeModeWindowManager(false); | 240 maximize_mode_controller->EnableMaximizeModeWindowManager(false); |
| 241 } | 241 } |
| 242 | 242 |
| 243 // Tests that when the tray is created without the internal display being known, | 243 // Tests that when the tray is created without the internal display being known, |
| 244 // that it will still display correctly once the internal display is known. | 244 // that it will still display correctly once the internal display is known. |
| 245 TEST_F(TrayRotationLockTest, InternalDisplayNotAvailableAtCreation) { | 245 TEST_F(TrayRotationLockTest, InternalDisplayNotAvailableAtCreation) { |
| 246 int64 internal_display_id = gfx::Display::InternalDisplayId(); | 246 int64_t internal_display_id = gfx::Display::InternalDisplayId(); |
| 247 TearDownViews(); | 247 TearDownViews(); |
| 248 gfx::Display::SetInternalDisplayId(gfx::Display::kInvalidDisplayID); | 248 gfx::Display::SetInternalDisplayId(gfx::Display::kInvalidDisplayID); |
| 249 | 249 |
| 250 scoped_ptr<TrayRotationLock> tray(new TrayRotationLock( | 250 scoped_ptr<TrayRotationLock> tray(new TrayRotationLock( |
| 251 StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray())); | 251 StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray())); |
| 252 | 252 |
| 253 gfx::Display::SetInternalDisplayId(internal_display_id); | 253 gfx::Display::SetInternalDisplayId(internal_display_id); |
| 254 scoped_ptr<views::View> tray_view(CreateTrayView(tray.get())); | 254 scoped_ptr<views::View> tray_view(CreateTrayView(tray.get())); |
| 255 scoped_ptr<views::View> default_view(tray->CreateDefaultView( | 255 scoped_ptr<views::View> default_view(tray->CreateDefaultView( |
| 256 StatusAreaWidgetTestHelper::GetUserLoginStatus())); | 256 StatusAreaWidgetTestHelper::GetUserLoginStatus())); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 269 ->EnableMaximizeModeWindowManager(true); | 269 ->EnableMaximizeModeWindowManager(true); |
| 270 DestroyTrayView(); | 270 DestroyTrayView(); |
| 271 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( | 271 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( |
| 272 true); | 272 true); |
| 273 Shell::GetInstance() | 273 Shell::GetInstance() |
| 274 ->maximize_mode_controller() | 274 ->maximize_mode_controller() |
| 275 ->EnableMaximizeModeWindowManager(false); | 275 ->EnableMaximizeModeWindowManager(false); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace ash | 278 } // namespace ash |
| OLD | NEW |