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

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

Issue 1924703002: Rename gfx::Display/Screen to display::Display/Screen in ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/system/chromeos/rotation/tray_rotation_lock.cc ('k') | ash/system/chromeos/tray_display.cc » ('j') | 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/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 default_view()->OnGestureEvent(&tap); 237 default_view()->OnGestureEvent(&tap);
238 EXPECT_TRUE(screen_orientation_controller->rotation_locked()); 238 EXPECT_TRUE(screen_orientation_controller->rotation_locked());
239 EXPECT_TRUE(tray_view()->visible()); 239 EXPECT_TRUE(tray_view()->visible());
240 240
241 maximize_mode_controller->EnableMaximizeModeWindowManager(false); 241 maximize_mode_controller->EnableMaximizeModeWindowManager(false);
242 } 242 }
243 243
244 // Tests that when the tray is created without the internal display being known, 244 // Tests that when the tray is created without the internal display being known,
245 // that it will still display correctly once the internal display is known. 245 // that it will still display correctly once the internal display is known.
246 TEST_F(TrayRotationLockTest, InternalDisplayNotAvailableAtCreation) { 246 TEST_F(TrayRotationLockTest, InternalDisplayNotAvailableAtCreation) {
247 int64_t internal_display_id = gfx::Display::InternalDisplayId(); 247 int64_t internal_display_id = display::Display::InternalDisplayId();
248 TearDownViews(); 248 TearDownViews();
249 gfx::Display::SetInternalDisplayId(gfx::Display::kInvalidDisplayID); 249 display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID);
250 250
251 std::unique_ptr<TrayRotationLock> tray(new TrayRotationLock( 251 std::unique_ptr<TrayRotationLock> tray(new TrayRotationLock(
252 StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray())); 252 StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray()));
253 253
254 gfx::Display::SetInternalDisplayId(internal_display_id); 254 display::Display::SetInternalDisplayId(internal_display_id);
255 std::unique_ptr<views::View> tray_view(CreateTrayView(tray.get())); 255 std::unique_ptr<views::View> tray_view(CreateTrayView(tray.get()));
256 std::unique_ptr<views::View> default_view(tray->CreateDefaultView( 256 std::unique_ptr<views::View> default_view(tray->CreateDefaultView(
257 StatusAreaWidgetTestHelper::GetUserLoginStatus())); 257 StatusAreaWidgetTestHelper::GetUserLoginStatus()));
258 EXPECT_TRUE(default_view); 258 EXPECT_TRUE(default_view);
259 Shell::GetInstance() 259 Shell::GetInstance()
260 ->maximize_mode_controller() 260 ->maximize_mode_controller()
261 ->EnableMaximizeModeWindowManager(true); 261 ->EnableMaximizeModeWindowManager(true);
262 EXPECT_TRUE(default_view->visible()); 262 EXPECT_TRUE(default_view->visible());
263 } 263 }
264 264
265 // Tests that when the tray view is deleted, while TrayRotationLock has not been 265 // Tests that when the tray view is deleted, while TrayRotationLock has not been
266 // deleted, that updates to the rotation lock state do not crash. 266 // deleted, that updates to the rotation lock state do not crash.
267 TEST_F(TrayRotationLockTest, LockUpdatedDuringDesctruction) { 267 TEST_F(TrayRotationLockTest, LockUpdatedDuringDesctruction) {
268 Shell::GetInstance() 268 Shell::GetInstance()
269 ->maximize_mode_controller() 269 ->maximize_mode_controller()
270 ->EnableMaximizeModeWindowManager(true); 270 ->EnableMaximizeModeWindowManager(true);
271 DestroyTrayView(); 271 DestroyTrayView();
272 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( 272 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked(
273 true); 273 true);
274 Shell::GetInstance() 274 Shell::GetInstance()
275 ->maximize_mode_controller() 275 ->maximize_mode_controller()
276 ->EnableMaximizeModeWindowManager(false); 276 ->EnableMaximizeModeWindowManager(false);
277 } 277 }
278 278
279 } // namespace ash 279 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/rotation/tray_rotation_lock.cc ('k') | ash/system/chromeos/tray_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698