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

Unified Diff: ash/content/display/screen_orientation_controller_chromeos_unittest.cc

Issue 2355063002: Separate ash::test::DisplayManagerTestApi from ash (Closed)
Patch Set: review comment Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ash/content/display/screen_orientation_controller_chromeos_unittest.cc
diff --git a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
index 53bfcdb81518b980e3a3590fbdc9995a9585a835..6851fa6bcf3eaa07473f59be4d04b8f705765789 100644
--- a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
+++ b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
@@ -422,7 +422,8 @@ TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) {
EnableMaximizeMode(true);
test::TestSystemTrayDelegate* tray_delegate = GetSystemTrayDelegate();
tray_delegate->set_should_show_display_notification(true);
- test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
+ test::DisplayManagerTestApi(display_manager())
+ .SetFirstDisplayAsInternalDisplay();
message_center::MessageCenter* message_center =
message_center::MessageCenter::Get();
@@ -474,7 +475,8 @@ TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) {
// Tests that if a user has set a display rotation that it is restored upon
// exiting maximize mode.
TEST_F(ScreenOrientationControllerTest, ResetUserRotationUponExit) {
- test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
+ test::DisplayManagerTestApi(display_manager())
+ .SetFirstDisplayAsInternalDisplay();
SetInternalDisplayRotation(display::Display::ROTATE_90);
EnableMaximizeMode(true);
@@ -600,7 +602,8 @@ TEST_F(ScreenOrientationControllerTest, UserRotationLockDisallowsRotation) {
// ready, that ScreenOrientationController still begins listening to events,
// which require an internal display to be acted upon.
TEST_F(ScreenOrientationControllerTest, InternalDisplayNotAvailableAtStartup) {
- test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
+ test::DisplayManagerTestApi(display_manager())
+ .SetFirstDisplayAsInternalDisplay();
int64_t internal_display_id = display::Display::InternalDisplayId();
display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID);
@@ -643,22 +646,22 @@ TEST_F(ScreenOrientationControllerTest, RotateInactiveDisplay) {
// The display::ManagedDisplayInfo list with two active displays needs to be
// added first so that the DisplayManager can track the
// |internal_display_info| as inactive instead of non-existent.
- DisplayManager* display_manager = Shell::GetInstance()->display_manager();
- display_manager->UpdateDisplaysWith(display_info_list_two_active);
- display_manager->UpdateDisplaysWith(display_info_list_one_active);
+ display_manager()->UpdateDisplaysWith(display_info_list_two_active);
+ display_manager()->UpdateDisplaysWith(display_info_list_one_active);
- test::ScopedSetInternalDisplayId set_internal(kInternalDisplayId);
+ test::ScopedSetInternalDisplayId set_internal(display_manager(),
+ kInternalDisplayId);
- ASSERT_NE(
- kNewRotation,
- display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation());
+ ASSERT_NE(kNewRotation, display_manager()
+ ->GetDisplayInfo(kInternalDisplayId)
+ .GetActiveRotation());
Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation(
kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE);
- EXPECT_EQ(
- kNewRotation,
- display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation());
+ EXPECT_EQ(kNewRotation, display_manager()
+ ->GetDisplayInfo(kInternalDisplayId)
+ .GetActiveRotation());
}
} // namespace ash
« no previous file with comments | « ash/accelerators/accelerator_controller_delegate_aura.cc ('k') | ash/display/cursor_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698