| Index: ash/display/display_manager_unittest.cc
|
| diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
|
| index 7a9968fbe2de97e9de0dd22f238172811feb59e0..b9c6462cf6d83f8eb4b4c9086f06b04d51db4574 100644
|
| --- a/ash/display/display_manager_unittest.cc
|
| +++ b/ash/display/display_manager_unittest.cc
|
| @@ -6,7 +6,6 @@
|
|
|
| #include "ash/accelerators/accelerator_commands_aura.h"
|
| #include "ash/common/ash_switches.h"
|
| -#include "ash/common/display/display_info.h"
|
| #include "ash/common/material_design/material_design_controller.h"
|
| #include "ash/common/wm/window_state.h"
|
| #include "ash/display/display_configuration_controller.h"
|
| @@ -32,6 +31,7 @@
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/display/display.h"
|
| #include "ui/display/display_observer.h"
|
| +#include "ui/display/manager/display_info.h"
|
| #include "ui/display/manager/display_layout_builder.h"
|
| #include "ui/display/manager/display_layout_store.h"
|
| #include "ui/display/screen.h"
|
| @@ -96,11 +96,11 @@ class DisplayManagerTest : public test::AshMDTestBase,
|
|
|
| bool root_window_destroyed() const { return root_window_destroyed_; }
|
|
|
| - const DisplayInfo& GetDisplayInfo(const display::Display& display) {
|
| + const ui::DisplayInfo& GetDisplayInfo(const display::Display& display) {
|
| return display_manager()->GetDisplayInfo(display.id());
|
| }
|
|
|
| - const DisplayInfo& GetDisplayInfoAt(int index) {
|
| + const ui::DisplayInfo& GetDisplayInfoAt(int index) {
|
| return GetDisplayInfo(display_manager()->GetDisplayAt(index));
|
| }
|
|
|
| @@ -108,7 +108,7 @@ class DisplayManagerTest : public test::AshMDTestBase,
|
| return display_manager()->GetDisplayForId(id);
|
| }
|
|
|
| - const DisplayInfo& GetDisplayInfoForId(int64_t id) {
|
| + const ui::DisplayInfo& GetDisplayInfoForId(int64_t id) {
|
| return GetDisplayInfo(display_manager()->GetDisplayForId(id));
|
| }
|
|
|
| @@ -205,7 +205,7 @@ TEST_P(DisplayManagerTest, UpdateDisplayTest) {
|
| reset();
|
|
|
| // # of display can go to zero when screen is off.
|
| - const vector<DisplayInfo> empty;
|
| + const vector<ui::DisplayInfo> empty;
|
| display_manager()->OnNativeDisplaysChanged(empty);
|
| EXPECT_EQ(1U, display_manager()->GetNumDisplays());
|
| EXPECT_EQ("0 0 0", GetCountSummary());
|
| @@ -486,8 +486,8 @@ TEST_P(DisplayManagerTest, OverscanInsetsTest) {
|
| UpdateDisplay("0+0-500x500,0+501-400x400");
|
| reset();
|
| ASSERT_EQ(2u, display_manager()->GetNumDisplays());
|
| - const DisplayInfo& display_info1 = GetDisplayInfoAt(0);
|
| - const DisplayInfo& display_info2 = GetDisplayInfoAt(1);
|
| + const ui::DisplayInfo& display_info1 = GetDisplayInfoAt(0);
|
| + const ui::DisplayInfo& display_info2 = GetDisplayInfoAt(1);
|
| display_manager()->SetOverscanInsets(display_info2.id(),
|
| gfx::Insets(13, 12, 11, 10));
|
|
|
| @@ -495,7 +495,7 @@ TEST_P(DisplayManagerTest, OverscanInsetsTest) {
|
| EXPECT_EQ(1u, changed_displays.size());
|
| EXPECT_EQ(display_info2.id(), changed_displays[0].id());
|
| EXPECT_EQ("0,0 500x500", GetDisplayInfoAt(0).bounds_in_native().ToString());
|
| - DisplayInfo updated_display_info2 = GetDisplayInfoAt(1);
|
| + ui::DisplayInfo updated_display_info2 = GetDisplayInfoAt(1);
|
| EXPECT_EQ("0,501 400x400",
|
| updated_display_info2.bounds_in_native().ToString());
|
| EXPECT_EQ("378x376", updated_display_info2.size_in_pixel().ToString());
|
| @@ -533,7 +533,7 @@ TEST_P(DisplayManagerTest, OverscanInsetsTest) {
|
| // Recreate the displays with the same ID. It should apply the overscan
|
| // inset.
|
| UpdateDisplay("0+0-500x500");
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(display_info1);
|
| display_info_list.push_back(display_info2);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| @@ -642,8 +642,8 @@ TEST_P(DisplayManagerTest, TestDeviceScaleOnlyChange) {
|
| Shell::GetPrimaryRootWindow()->bounds().size().ToString());
|
| }
|
|
|
| -DisplayInfo CreateDisplayInfo(int64_t id, const gfx::Rect& bounds) {
|
| - DisplayInfo info(id, ToDisplayName(id), false);
|
| +ui::DisplayInfo CreateDisplayInfo(int64_t id, const gfx::Rect& bounds) {
|
| + ui::DisplayInfo info(id, ToDisplayName(id), false);
|
| info.SetBounds(bounds);
|
| return info;
|
| }
|
| @@ -654,11 +654,11 @@ TEST_P(DisplayManagerTest, TestNativeDisplaysChanged) {
|
| const int external_id = 10;
|
| const int mirror_id = 11;
|
| const int64_t invalid_id = display::Display::kInvalidDisplayID;
|
| - const DisplayInfo internal_display_info =
|
| + const ui::DisplayInfo internal_display_info =
|
| CreateDisplayInfo(internal_display_id, gfx::Rect(0, 0, 500, 500));
|
| - const DisplayInfo external_display_info =
|
| + const ui::DisplayInfo external_display_info =
|
| CreateDisplayInfo(external_id, gfx::Rect(1, 1, 100, 100));
|
| - const DisplayInfo mirroring_display_info =
|
| + const ui::DisplayInfo mirroring_display_info =
|
| CreateDisplayInfo(mirror_id, gfx::Rect(0, 0, 500, 500));
|
|
|
| EXPECT_EQ(1U, display_manager()->GetNumDisplays());
|
| @@ -666,7 +666,7 @@ TEST_P(DisplayManagerTest, TestNativeDisplaysChanged) {
|
| std::string default_bounds =
|
| display_manager()->GetDisplayAt(0).bounds().ToString();
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| // Primary disconnected.
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| EXPECT_EQ(1U, display_manager()->GetNumDisplays());
|
| @@ -824,16 +824,17 @@ TEST_P(DisplayManagerTest, DisplayAddRemoveAtTheSameTime) {
|
| const int64_t primary_id = WindowTreeHostManager::GetPrimaryDisplayId();
|
| const int64_t secondary_id = ScreenUtil::GetSecondaryDisplay().id();
|
|
|
| - DisplayInfo primary_info = display_manager()->GetDisplayInfo(primary_id);
|
| - DisplayInfo secondary_info = display_manager()->GetDisplayInfo(secondary_id);
|
| + ui::DisplayInfo primary_info = display_manager()->GetDisplayInfo(primary_id);
|
| + ui::DisplayInfo secondary_info =
|
| + display_manager()->GetDisplayInfo(secondary_id);
|
|
|
| // An id which is different from primary and secondary.
|
| const int64_t third_id = secondary_id + 1;
|
|
|
| - DisplayInfo third_info =
|
| + ui::DisplayInfo third_info =
|
| CreateDisplayInfo(third_id, gfx::Rect(0, 0, 600, 600));
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(third_info);
|
| display_info_list.push_back(secondary_info);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| @@ -851,12 +852,12 @@ TEST_P(DisplayManagerTest, TestNativeDisplaysChangedNoInternal) {
|
| EXPECT_EQ(1U, display_manager()->GetNumDisplays());
|
|
|
| // Don't change the display info if all displays are disconnected.
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| EXPECT_EQ(1U, display_manager()->GetNumDisplays());
|
|
|
| // Connect another display which will become primary.
|
| - const DisplayInfo external_display_info =
|
| + const ui::DisplayInfo external_display_info =
|
| CreateDisplayInfo(10, gfx::Rect(1, 1, 100, 100));
|
| display_info_list.push_back(external_display_info);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| @@ -877,12 +878,12 @@ TEST_P(DisplayManagerTest, NativeDisplaysChangedAfterPrimaryChange) {
|
|
|
| const int64_t internal_display_id =
|
| test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
|
| - const DisplayInfo native_display_info =
|
| + const ui::DisplayInfo native_display_info =
|
| CreateDisplayInfo(internal_display_id, gfx::Rect(0, 0, 500, 500));
|
| - const DisplayInfo secondary_display_info =
|
| + const ui::DisplayInfo secondary_display_info =
|
| CreateDisplayInfo(10, gfx::Rect(1, 1, 100, 100));
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(native_display_info);
|
| display_info_list.push_back(secondary_display_info);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| @@ -909,25 +910,25 @@ TEST_P(DisplayManagerTest, NativeDisplaysChangedAfterPrimaryChange) {
|
| #if defined(OS_CHROMEOS)
|
| TEST_P(DisplayManagerTest, DontRememberBestResolution) {
|
| int display_id = 1000;
|
| - DisplayInfo native_display_info =
|
| + ui::DisplayInfo native_display_info =
|
| CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1000, 500));
|
| - DisplayInfo::ManagedDisplayModeList display_modes;
|
| + ui::DisplayInfo::ManagedDisplayModeList display_modes;
|
| display_modes.push_back(make_scoped_refptr(
|
| - new ManagedDisplayMode(gfx::Size(1000, 500), 58.0f, false, true)));
|
| + new ui::ManagedDisplayMode(gfx::Size(1000, 500), 58.0f, false, true)));
|
| display_modes.push_back(make_scoped_refptr(
|
| - new ManagedDisplayMode(gfx::Size(800, 300), 59.0f, false, false)));
|
| + new ui::ManagedDisplayMode(gfx::Size(800, 300), 59.0f, false, false)));
|
| display_modes.push_back(make_scoped_refptr(
|
| - new ManagedDisplayMode(gfx::Size(400, 500), 60.0f, false, false)));
|
| + new ui::ManagedDisplayMode(gfx::Size(400, 500), 60.0f, false, false)));
|
|
|
| native_display_info.SetManagedDisplayModes(display_modes);
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(native_display_info);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
|
|
| - scoped_refptr<ManagedDisplayMode> mode;
|
| - scoped_refptr<ManagedDisplayMode> expected_mode(
|
| - new ManagedDisplayMode(gfx::Size(1000, 500), 0.0f, false, false));
|
| + scoped_refptr<ui::ManagedDisplayMode> mode;
|
| + scoped_refptr<ui::ManagedDisplayMode> expected_mode(
|
| + new ui::ManagedDisplayMode(gfx::Size(1000, 500), 0.0f, false, false));
|
|
|
| mode = display_manager()->GetSelectedModeForDisplayId(display_id);
|
| EXPECT_FALSE(!!mode);
|
| @@ -950,7 +951,7 @@ TEST_P(DisplayManagerTest, DontRememberBestResolution) {
|
| EXPECT_FALSE(mode->native());
|
|
|
| expected_mode =
|
| - new ManagedDisplayMode(gfx::Size(800, 300), 0.0f, false, false);
|
| + new ui::ManagedDisplayMode(gfx::Size(800, 300), 0.0f, false, false);
|
|
|
| EXPECT_TRUE(expected_mode->IsEquivalent(
|
| display_manager()->GetActiveModeForDisplayId(display_id)));
|
| @@ -964,7 +965,7 @@ TEST_P(DisplayManagerTest, DontRememberBestResolution) {
|
| EXPECT_TRUE(mode->native());
|
|
|
| expected_mode =
|
| - new ManagedDisplayMode(gfx::Size(1000, 500), 0.0f, false, false);
|
| + new ui::ManagedDisplayMode(gfx::Size(1000, 500), 0.0f, false, false);
|
|
|
| EXPECT_TRUE(expected_mode->IsEquivalent(
|
| display_manager()->GetActiveModeForDisplayId(display_id)));
|
| @@ -975,33 +976,33 @@ TEST_P(DisplayManagerTest, DontRememberBestResolution) {
|
| #if defined(OS_CHROMEOS)
|
| TEST_P(DisplayManagerTest, ResolutionFallback) {
|
| int display_id = 1000;
|
| - DisplayInfo native_display_info =
|
| + ui::DisplayInfo native_display_info =
|
| CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1000, 500));
|
| - DisplayInfo::ManagedDisplayModeList display_modes;
|
| + ui::DisplayInfo::ManagedDisplayModeList display_modes;
|
| display_modes.push_back(make_scoped_refptr(
|
| - new ManagedDisplayMode(gfx::Size(1000, 500), 58.0f, false, true)));
|
| + new ui::ManagedDisplayMode(gfx::Size(1000, 500), 58.0f, false, true)));
|
| display_modes.push_back(make_scoped_refptr(
|
| - new ManagedDisplayMode(gfx::Size(800, 300), 59.0f, false, false)));
|
| + new ui::ManagedDisplayMode(gfx::Size(800, 300), 59.0f, false, false)));
|
| display_modes.push_back(make_scoped_refptr(
|
| - new ManagedDisplayMode(gfx::Size(400, 500), 60.0f, false, false)));
|
| + new ui::ManagedDisplayMode(gfx::Size(400, 500), 60.0f, false, false)));
|
|
|
| - DisplayInfo::ManagedDisplayModeList copy = display_modes;
|
| + ui::DisplayInfo::ManagedDisplayModeList copy = display_modes;
|
| native_display_info.SetManagedDisplayModes(copy);
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(native_display_info);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| {
|
| test::SetDisplayResolution(display_id, gfx::Size(800, 300));
|
| - DisplayInfo new_native_display_info =
|
| + ui::DisplayInfo new_native_display_info =
|
| CreateDisplayInfo(display_id, gfx::Rect(0, 0, 400, 500));
|
| copy = display_modes;
|
| new_native_display_info.SetManagedDisplayModes(copy);
|
| - std::vector<DisplayInfo> new_display_info_list;
|
| + std::vector<ui::DisplayInfo> new_display_info_list;
|
| new_display_info_list.push_back(new_native_display_info);
|
| display_manager()->OnNativeDisplaysChanged(new_display_info_list);
|
|
|
| - scoped_refptr<ManagedDisplayMode> mode =
|
| + scoped_refptr<ui::ManagedDisplayMode> mode =
|
| display_manager()->GetSelectedModeForDisplayId(display_id);
|
| EXPECT_TRUE(!!mode);
|
| EXPECT_EQ("400x500", mode->size().ToString());
|
| @@ -1011,15 +1012,15 @@ TEST_P(DisplayManagerTest, ResolutionFallback) {
|
| {
|
| // Best resolution should find itself on the resolutions list.
|
| test::SetDisplayResolution(display_id, gfx::Size(800, 300));
|
| - DisplayInfo new_native_display_info =
|
| + ui::DisplayInfo new_native_display_info =
|
| CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1000, 500));
|
| - DisplayInfo::ManagedDisplayModeList copy = display_modes;
|
| + ui::DisplayInfo::ManagedDisplayModeList copy = display_modes;
|
| new_native_display_info.SetManagedDisplayModes(copy);
|
| - std::vector<DisplayInfo> new_display_info_list;
|
| + std::vector<ui::DisplayInfo> new_display_info_list;
|
| new_display_info_list.push_back(new_native_display_info);
|
| display_manager()->OnNativeDisplaysChanged(new_display_info_list);
|
|
|
| - scoped_refptr<ManagedDisplayMode> mode =
|
| + scoped_refptr<ui::ManagedDisplayMode> mode =
|
| display_manager()->GetSelectedModeForDisplayId(display_id);
|
| EXPECT_TRUE(!!mode);
|
| EXPECT_EQ("1000x500", mode->size().ToString());
|
| @@ -1090,15 +1091,15 @@ TEST_P(DisplayManagerTest, Rotate) {
|
| internal_display_id, display::Display::ROTATE_0,
|
| display::Display::ROTATION_SOURCE_ACTIVE);
|
|
|
| - const DisplayInfo info = GetDisplayInfoForId(internal_display_id);
|
| + const ui::DisplayInfo info = GetDisplayInfoForId(internal_display_id);
|
| EXPECT_EQ(display::Display::ROTATE_0, info.GetActiveRotation());
|
|
|
| // Deactivate internal display to simulate Docked Mode.
|
| - vector<DisplayInfo> secondary_only;
|
| + vector<ui::DisplayInfo> secondary_only;
|
| secondary_only.push_back(GetDisplayInfoAt(1));
|
| display_manager()->OnNativeDisplaysChanged(secondary_only);
|
|
|
| - const DisplayInfo post_removal_info =
|
| + const ui::DisplayInfo post_removal_info =
|
| display_manager()->display_info_[internal_display_id];
|
| EXPECT_NE(info.GetActiveRotation(), post_removal_info.GetActiveRotation());
|
| EXPECT_EQ(display::Display::ROTATE_90, post_removal_info.GetActiveRotation());
|
| @@ -1106,7 +1107,7 @@ TEST_P(DisplayManagerTest, Rotate) {
|
| display_manager()->SetDisplayRotation(
|
| internal_display_id, display::Display::ROTATE_180,
|
| display::Display::ROTATION_SOURCE_ACTIVE);
|
| - const DisplayInfo post_rotation_info =
|
| + const ui::DisplayInfo post_rotation_info =
|
| display_manager()->display_info_[internal_display_id];
|
| EXPECT_NE(info.GetActiveRotation(), post_rotation_info.GetActiveRotation());
|
| EXPECT_EQ(display::Display::ROTATE_180,
|
| @@ -1214,19 +1215,19 @@ TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) {
|
| int display_id = 1000;
|
|
|
| // Setup the display modes with UI-scale.
|
| - DisplayInfo native_display_info =
|
| + ui::DisplayInfo native_display_info =
|
| CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1280, 800));
|
| - const scoped_refptr<ManagedDisplayMode>& base_mode(
|
| - new ManagedDisplayMode(gfx::Size(1280, 800), 60.0f, false, false));
|
| - DisplayInfo::ManagedDisplayModeList mode_list =
|
| + const scoped_refptr<ui::ManagedDisplayMode>& base_mode(
|
| + new ui::ManagedDisplayMode(gfx::Size(1280, 800), 60.0f, false, false));
|
| + ui::DisplayInfo::ManagedDisplayModeList mode_list =
|
| CreateInternalManagedDisplayModeList(base_mode);
|
| native_display_info.SetManagedDisplayModes(mode_list);
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(native_display_info);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
|
|
| - scoped_refptr<ManagedDisplayMode> expected_mode = base_mode;
|
| + scoped_refptr<ui::ManagedDisplayMode> expected_mode = base_mode;
|
| EXPECT_TRUE(expected_mode->IsEquivalent(
|
| display_manager()->GetActiveModeForDisplayId(display_id)));
|
|
|
| @@ -1243,7 +1244,7 @@ TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) {
|
| SetDisplayUIScale(display_id, 1.125f);
|
| EXPECT_EQ(1.125f, GetDisplayInfoAt(0).configured_ui_scale());
|
|
|
| - expected_mode = new ManagedDisplayMode(
|
| + expected_mode = new ui::ManagedDisplayMode(
|
| expected_mode->size(), expected_mode->refresh_rate(),
|
| expected_mode->is_interlaced(), expected_mode->native(),
|
| 1.125f /* ui_scale */, expected_mode->device_scale_factor());
|
| @@ -1253,7 +1254,7 @@ TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) {
|
| SetDisplayUIScale(display_id, 0.8f);
|
| EXPECT_EQ(0.8f, GetDisplayInfoAt(0).configured_ui_scale());
|
|
|
| - expected_mode = new ManagedDisplayMode(
|
| + expected_mode = new ui::ManagedDisplayMode(
|
| expected_mode->size(), expected_mode->refresh_rate(),
|
| expected_mode->is_interlaced(), expected_mode->native(),
|
| 0.8f /* ui_scale */, expected_mode->device_scale_factor());
|
| @@ -1267,7 +1268,7 @@ TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) {
|
| SetDisplayUIScale(display_id, 0.625f);
|
| EXPECT_EQ(0.625f, GetDisplayInfoAt(0).configured_ui_scale());
|
|
|
| - expected_mode = new ManagedDisplayMode(
|
| + expected_mode = new ui::ManagedDisplayMode(
|
| expected_mode->size(), expected_mode->refresh_rate(),
|
| expected_mode->is_interlaced(), expected_mode->native(),
|
| 0.625f /* ui_scale */, expected_mode->device_scale_factor());
|
| @@ -1281,7 +1282,7 @@ TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) {
|
| SetDisplayUIScale(display_id, 0.5f);
|
| EXPECT_EQ(0.5f, GetDisplayInfoAt(0).configured_ui_scale());
|
|
|
| - expected_mode = new ManagedDisplayMode(
|
| + expected_mode = new ui::ManagedDisplayMode(
|
| expected_mode->size(), expected_mode->refresh_rate(),
|
| expected_mode->is_interlaced(), expected_mode->native(),
|
| 0.5f /* ui_scale */, expected_mode->device_scale_factor());
|
| @@ -1326,17 +1327,17 @@ TEST_P(DisplayManagerTest, FHD125DefaultsTo08UIScaling) {
|
| test::ScopedSetInternalDisplayId set_internal(display_id);
|
|
|
| // Setup the display modes with UI-scale.
|
| - DisplayInfo native_display_info =
|
| + ui::DisplayInfo native_display_info =
|
| CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1920, 1080));
|
| native_display_info.set_device_scale_factor(1.25);
|
|
|
| - const scoped_refptr<ManagedDisplayMode>& base_mode(
|
| - new ManagedDisplayMode(gfx::Size(1920, 1080), 60.0f, false, false));
|
| - DisplayInfo::ManagedDisplayModeList mode_list =
|
| + const scoped_refptr<ui::ManagedDisplayMode>& base_mode(
|
| + new ui::ManagedDisplayMode(gfx::Size(1920, 1080), 60.0f, false, false));
|
| + ui::DisplayInfo::ManagedDisplayModeList mode_list =
|
| CreateInternalManagedDisplayModeList(base_mode);
|
| native_display_info.SetManagedDisplayModes(mode_list);
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(native_display_info);
|
|
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| @@ -1361,17 +1362,17 @@ TEST_P(DisplayManagerTest, FHD125DefaultsTo08UIScalingNoOverride) {
|
| gfx::Size(), 1.0f, ui::ColorCalibrationProfile());
|
|
|
| // Setup the display modes with UI-scale.
|
| - DisplayInfo native_display_info =
|
| + ui::DisplayInfo native_display_info =
|
| CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1920, 1080));
|
| native_display_info.set_device_scale_factor(1.25);
|
|
|
| - const scoped_refptr<ManagedDisplayMode>& base_mode(
|
| - new ManagedDisplayMode(gfx::Size(1920, 1080), 60.0f, false, false));
|
| - DisplayInfo::ManagedDisplayModeList mode_list =
|
| + const scoped_refptr<ui::ManagedDisplayMode>& base_mode(
|
| + new ui::ManagedDisplayMode(gfx::Size(1920, 1080), 60.0f, false, false));
|
| + ui::DisplayInfo::ManagedDisplayModeList mode_list =
|
| CreateInternalManagedDisplayModeList(base_mode);
|
| native_display_info.SetManagedDisplayModes(mode_list);
|
|
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(native_display_info);
|
|
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| @@ -1392,7 +1393,7 @@ TEST_P(DisplayManagerTest, ResolutionChangeInUnifiedMode) {
|
| UpdateDisplay("200x200, 400x400");
|
|
|
| int64_t unified_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
|
| - DisplayInfo info = display_manager()->GetDisplayInfo(unified_id);
|
| + ui::DisplayInfo info = display_manager()->GetDisplayInfo(unified_id);
|
| ASSERT_EQ(2u, info.display_modes().size());
|
| EXPECT_EQ("400x200", info.display_modes()[0]->size().ToString());
|
| EXPECT_TRUE(info.display_modes()[0]->native());
|
| @@ -1401,7 +1402,7 @@ TEST_P(DisplayManagerTest, ResolutionChangeInUnifiedMode) {
|
| EXPECT_EQ(
|
| "400x200",
|
| display::Screen::GetScreen()->GetPrimaryDisplay().size().ToString());
|
| - scoped_refptr<ManagedDisplayMode> active_mode =
|
| + scoped_refptr<ui::ManagedDisplayMode> active_mode =
|
| display_manager()->GetActiveModeForDisplayId(unified_id);
|
| EXPECT_EQ(1.0f, active_mode->ui_scale());
|
| EXPECT_EQ("400x200", active_mode->size().ToString());
|
| @@ -1629,7 +1630,7 @@ TEST_P(DisplayManagerTest, SoftwareMirroringWithCompositingCursor) {
|
| EXPECT_EQ(nullptr, test_api.GetHost());
|
|
|
| DisplayManager* display_manager = Shell::GetInstance()->display_manager();
|
| - DisplayInfo secondary_info =
|
| + ui::DisplayInfo secondary_info =
|
| display_manager->GetDisplayInfo(ScreenUtil::GetSecondaryDisplay().id());
|
|
|
| display_manager->SetSoftwareMirroring(true);
|
| @@ -1644,7 +1645,7 @@ TEST_P(DisplayManagerTest, SoftwareMirroringWithCompositingCursor) {
|
|
|
| // Removes the first display and keeps the second one.
|
| display_manager->SetSoftwareMirroring(false);
|
| - std::vector<DisplayInfo> new_info_list;
|
| + std::vector<ui::DisplayInfo> new_info_list;
|
| new_info_list.push_back(secondary_info);
|
| display_manager->OnNativeDisplaysChanged(new_info_list);
|
|
|
| @@ -1760,9 +1761,9 @@ TEST_P(DisplayManagerTest, NotifyPrimaryChangeUndock) {
|
| return;
|
| // Assume the default display is an external display, and
|
| // emulates undocking by switching to another display.
|
| - DisplayInfo another_display_info =
|
| + ui::DisplayInfo another_display_info =
|
| CreateDisplayInfo(1, gfx::Rect(0, 0, 1280, 800));
|
| - std::vector<DisplayInfo> info_list;
|
| + std::vector<ui::DisplayInfo> info_list;
|
| info_list.push_back(another_display_info);
|
| reset();
|
| display_manager()->OnNativeDisplaysChanged(info_list);
|
| @@ -1849,7 +1850,7 @@ TEST_P(DisplayManagerTest, UnifiedDesktopBasic) {
|
| EXPECT_EQ(gfx::Size(739, 300), screen->GetPrimaryDisplay().size());
|
|
|
| // The default should fit to the internal display.
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(CreateDisplayInfo(10, gfx::Rect(0, 0, 500, 300)));
|
| display_info_list.push_back(
|
| CreateDisplayInfo(11, gfx::Rect(500, 0, 400, 500)));
|
| @@ -1881,11 +1882,11 @@ TEST_P(DisplayManagerTest, UnifiedDesktopWithHardwareMirroring) {
|
| Shell::GetPrimaryRootWindow()->RemoveObserver(this);
|
|
|
| // Enter to hardware mirroring.
|
| - DisplayInfo d1(1, "", false);
|
| + ui::DisplayInfo d1(1, "", false);
|
| d1.SetBounds(gfx::Rect(0, 0, 500, 500));
|
| - DisplayInfo d2(2, "", false);
|
| + ui::DisplayInfo d2(2, "", false);
|
| d2.SetBounds(gfx::Rect(0, 0, 500, 500));
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
| display_info_list.push_back(d1);
|
| display_info_list.push_back(d2);
|
| display_manager()->OnNativeDisplaysChanged(display_info_list);
|
| @@ -1942,7 +1943,7 @@ TEST_P(DisplayManagerTest, UnifiedDesktopWith2xDSF) {
|
|
|
| // 2nd display is 2x.
|
| UpdateDisplay("400x500,1000x800*2");
|
| - DisplayInfo info =
|
| + ui::DisplayInfo info =
|
| display_manager()->GetDisplayInfo(screen->GetPrimaryDisplay().id());
|
| EXPECT_EQ(2u, info.display_modes().size());
|
| EXPECT_EQ("1640x800", info.display_modes()[0]->size().ToString());
|
| @@ -2109,11 +2110,11 @@ TEST_P(DisplayManagerTest, DockMode) {
|
| const int64_t internal_id = 1;
|
| const int64_t external_id = 2;
|
|
|
| - const DisplayInfo internal_display_info =
|
| + const ui::DisplayInfo internal_display_info =
|
| CreateDisplayInfo(internal_id, gfx::Rect(0, 0, 500, 500));
|
| - const DisplayInfo external_display_info =
|
| + const ui::DisplayInfo external_display_info =
|
| CreateDisplayInfo(external_id, gfx::Rect(1, 1, 100, 100));
|
| - std::vector<DisplayInfo> display_info_list;
|
| + std::vector<ui::DisplayInfo> display_info_list;
|
|
|
| // software mirroring.
|
| display_info_list.push_back(internal_display_info);
|
| @@ -2131,13 +2132,13 @@ TEST_P(DisplayManagerTest, DockMode) {
|
| EXPECT_TRUE(display_manager()->IsActiveDisplayId(external_id));
|
| EXPECT_FALSE(display_manager()->IsActiveDisplayId(internal_id));
|
|
|
| - const DisplayInfo& info = display_manager()->GetDisplayInfo(internal_id);
|
| + const ui::DisplayInfo& info = display_manager()->GetDisplayInfo(internal_id);
|
|
|
| EXPECT_FALSE(!!GetDisplayModeForNextUIScale(info, true));
|
| EXPECT_FALSE(!!GetDisplayModeForNextUIScale(info, false));
|
| EXPECT_FALSE(SetDisplayUIScale(internal_id, 1.0f));
|
|
|
| - DisplayInfo invalid_info;
|
| + ui::DisplayInfo invalid_info;
|
| EXPECT_FALSE(!!GetDisplayModeForNextUIScale(invalid_info, true));
|
| EXPECT_FALSE(!!GetDisplayModeForNextUIScale(invalid_info, false));
|
| EXPECT_FALSE(SetDisplayUIScale(display::Display::kInvalidDisplayID, 1.0f));
|
| @@ -2319,7 +2320,7 @@ TEST_P(DisplayManagerTest, CheckInitializationOfRotationProperty) {
|
| 1.0f, nullptr, gfx::Size(), 1.0f,
|
| ui::COLOR_PROFILE_STANDARD);
|
|
|
| - const DisplayInfo& info = display_manager()->GetDisplayInfo(id);
|
| + const ui::DisplayInfo& info = display_manager()->GetDisplayInfo(id);
|
|
|
| EXPECT_EQ(display::Display::ROTATE_90,
|
| info.GetRotation(display::Display::ROTATION_SOURCE_USER));
|
|
|