diff options
Diffstat (limited to 'ash/display/display_manager_unittest.cc')
-rw-r--r-- | ash/display/display_manager_unittest.cc | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 1fdaadd..f9c5c3c 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc @@ -830,7 +830,7 @@ TEST_F(DisplayManagerTest, DontRememberBestResolution) { display_modes.push_back( DisplayMode(gfx::Size(400, 500), 60.0f, false, false)); - native_display_info.set_display_modes(display_modes); + native_display_info.SetDisplayModes(display_modes); std::vector<DisplayInfo> display_info_list; display_info_list.push_back(native_display_info); @@ -887,7 +887,7 @@ TEST_F(DisplayManagerTest, ResolutionFallback) { DisplayMode(gfx::Size(400, 500), 60.0f, false, false)); std::vector<DisplayMode> copy = display_modes; - native_display_info.set_display_modes(copy); + native_display_info.SetDisplayModes(copy); std::vector<DisplayInfo> display_info_list; display_info_list.push_back(native_display_info); @@ -897,7 +897,7 @@ TEST_F(DisplayManagerTest, ResolutionFallback) { DisplayInfo new_native_display_info = CreateDisplayInfo(display_id, gfx::Rect(0, 0, 400, 500)); copy = display_modes; - new_native_display_info.set_display_modes(copy); + new_native_display_info.SetDisplayModes(copy); std::vector<DisplayInfo> new_display_info_list; new_display_info_list.push_back(new_native_display_info); display_manager()->OnNativeDisplaysChanged(new_display_info_list); @@ -915,7 +915,7 @@ TEST_F(DisplayManagerTest, ResolutionFallback) { DisplayInfo new_native_display_info = CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1000, 500)); std::vector<DisplayMode> copy = display_modes; - new_native_display_info.set_display_modes(copy); + new_native_display_info.SetDisplayModes(copy); std::vector<DisplayInfo> new_display_info_list; new_display_info_list.push_back(new_native_display_info); display_manager()->OnNativeDisplaysChanged(new_display_info_list); @@ -1000,7 +1000,8 @@ TEST_F(DisplayManagerTest, UIScale) { display_manager()->SetDisplayUIScale(display_id, 0.625f); EXPECT_EQ(1.0f, GetDisplayInfoAt(0).configured_ui_scale()); - gfx::Display::SetInternalDisplayId(display_id); + test::DisplayManagerTestApi(display_manager()) + .SetInternalDisplayId(display_id); display_manager()->SetDisplayUIScale(display_id, 1.5f); EXPECT_EQ(1.0f, GetDisplayInfoAt(0).configured_ui_scale()); @@ -1088,15 +1089,10 @@ TEST_F(DisplayManagerTest, UIScaleWithDisplayMode) { CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1280, 800)); std::vector<DisplayMode> display_modes; const DisplayMode base_mode(gfx::Size(1280, 800), 60.0f, false, false); - std::vector<float> scales = - DisplayManager::GetScalesForDisplay(native_display_info); - for (size_t i = 0; i < scales.size(); i++) { - DisplayMode mode = base_mode; - mode.ui_scale = scales[i]; - mode.native = (scales[i] == 1.0f); - display_modes.push_back(mode); - } - native_display_info.set_display_modes(display_modes); + std::vector<DisplayMode> mode_list = + DisplayManager::CreateInternalDisplayModeList(base_mode); + native_display_info.SetDisplayModes(mode_list); + std::vector<DisplayInfo> display_info_list; display_info_list.push_back(native_display_info); display_manager()->OnNativeDisplaysChanged(display_info_list); @@ -1122,7 +1118,8 @@ TEST_F(DisplayManagerTest, UIScaleWithDisplayMode) { EXPECT_TRUE(expected_mode.IsEquivalent( display_manager()->GetActiveModeForDisplayId(display_id))); - gfx::Display::SetInternalDisplayId(display_id); + test::DisplayManagerTestApi(display_manager()) + .SetInternalDisplayId(display_id); display_manager()->SetDisplayUIScale(display_id, 1.5f); EXPECT_EQ(1.0f, GetDisplayInfoAt(0).configured_ui_scale()); @@ -1163,10 +1160,12 @@ TEST_F(DisplayManagerTest, UIScaleWithDisplayMode) { } TEST_F(DisplayManagerTest, Use125DSFRorUIScaling) { - int64 display_id = Shell::GetScreen()->GetPrimaryDisplay().id(); - gfx::Display::SetInternalDisplayId(display_id); DisplayInfo::SetUse125DSFForUIScaling(true); + int64 display_id = Shell::GetScreen()->GetPrimaryDisplay().id(); + test::DisplayManagerTestApi(display_manager()) + .SetInternalDisplayId(display_id); + UpdateDisplay("1920x1080*1.25"); EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor()); EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveUIScale()); |