Index: ash/display/display_manager_unittest.cc |
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc |
index e915661ea02c4703bd1ff693fa5b8f5c99467cbe..8946afe452defe1972d08e396d805ceec4126cce 100644 |
--- a/ash/display/display_manager_unittest.cc |
+++ b/ash/display/display_manager_unittest.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ash/display/display_manager.h" |
+#include "ui/display/manager/display_manager.h" |
#include "ash/accelerators/accelerator_commands_aura.h" |
#include "ash/common/material_design/material_design_controller.h" |
@@ -15,7 +15,6 @@ |
#include "ash/shell.h" |
#include "ash/test/ash_md_test_base.h" |
#include "ash/test/ash_test_base.h" |
-#include "ash/test/display_manager_test_api.h" |
#include "ash/test/mirror_window_test_api.h" |
#include "ash/wm/window_state_aura.h" |
#include "base/command_line.h" |
@@ -37,6 +36,7 @@ |
#include "ui/display/manager/display_manager_utilities.h" |
#include "ui/display/manager/managed_display_info.h" |
#include "ui/display/screen.h" |
+#include "ui/display/test/display_manager_test_api.h" |
#include "ui/events/test/event_generator.h" |
#include "ui/gfx/font_render_params.h" |
@@ -354,7 +354,7 @@ TEST_P(DisplayManagerTest, LayoutMorethanThreeDisplaysTest) { |
return; |
int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
- display::DisplayIdList list = ash::test::CreateDisplayIdListN( |
+ display::DisplayIdList list = display::test::CreateDisplayIdListN( |
3, primary_id, primary_id + 1, primary_id + 2); |
{ |
// Layout: [2] |
@@ -425,9 +425,9 @@ TEST_P(DisplayManagerTest, LayoutMorethanThreeDisplaysTest) { |
} |
{ |
- list = ash::test::CreateDisplayIdListN(5, primary_id, primary_id + 1, |
- primary_id + 2, primary_id + 3, |
- primary_id + 4); |
+ list = display::test::CreateDisplayIdListN(5, primary_id, primary_id + 1, |
+ primary_id + 2, primary_id + 3, |
+ primary_id + 4); |
// Layout: [P][2] |
// [3][4] |
// [1] |
@@ -652,7 +652,7 @@ display::ManagedDisplayInfo CreateDisplayInfo(int64_t id, |
TEST_P(DisplayManagerTest, TestNativeDisplaysChanged) { |
const int64_t internal_display_id = |
- test::DisplayManagerTestApi(display_manager()) |
+ display::test::DisplayManagerTestApi(display_manager()) |
.SetFirstDisplayAsInternalDisplay(); |
const int external_id = 10; |
const int mirror_id = 11; |
@@ -881,7 +881,7 @@ TEST_P(DisplayManagerTest, NativeDisplaysChangedAfterPrimaryChange) { |
return; |
const int64_t internal_display_id = |
- test::DisplayManagerTestApi(display_manager()) |
+ display::test::DisplayManagerTestApi(display_manager()) |
.SetFirstDisplayAsInternalDisplay(); |
const display::ManagedDisplayInfo native_display_info = |
CreateDisplayInfo(internal_display_id, gfx::Rect(0, 0, 500, 500)); |
@@ -942,16 +942,16 @@ TEST_P(DisplayManagerTest, DontRememberBestResolution) { |
display_manager()->GetActiveModeForDisplayId(display_id))); |
// Unsupported resolution. |
- test::SetDisplayResolution(display_manager(), display_id, |
- gfx::Size(800, 4000)); |
+ display::test::SetDisplayResolution(display_manager(), display_id, |
+ gfx::Size(800, 4000)); |
mode = display_manager()->GetSelectedModeForDisplayId(display_id); |
EXPECT_FALSE(!!mode); |
EXPECT_TRUE(expected_mode->IsEquivalent( |
display_manager()->GetActiveModeForDisplayId(display_id))); |
// Supported resolution. |
- test::SetDisplayResolution(display_manager(), display_id, |
- gfx::Size(800, 300)); |
+ display::test::SetDisplayResolution(display_manager(), display_id, |
+ gfx::Size(800, 300)); |
mode = display_manager()->GetSelectedModeForDisplayId(display_id); |
EXPECT_TRUE(!!mode); |
EXPECT_EQ("800x300", mode->size().ToString()); |
@@ -965,8 +965,8 @@ TEST_P(DisplayManagerTest, DontRememberBestResolution) { |
display_manager()->GetActiveModeForDisplayId(display_id))); |
// Best resolution. |
- test::SetDisplayResolution(display_manager(), display_id, |
- gfx::Size(1000, 500)); |
+ display::test::SetDisplayResolution(display_manager(), display_id, |
+ gfx::Size(1000, 500)); |
mode = display_manager()->GetSelectedModeForDisplayId(display_id); |
EXPECT_TRUE(!!mode); |
EXPECT_EQ("1000x500", mode->size().ToString()); |
@@ -1002,8 +1002,8 @@ TEST_P(DisplayManagerTest, ResolutionFallback) { |
display_info_list.push_back(native_display_info); |
display_manager()->OnNativeDisplaysChanged(display_info_list); |
{ |
- test::SetDisplayResolution(display_manager(), display_id, |
- gfx::Size(800, 300)); |
+ display::test::SetDisplayResolution(display_manager(), display_id, |
+ gfx::Size(800, 300)); |
display::ManagedDisplayInfo new_native_display_info = |
CreateDisplayInfo(display_id, gfx::Rect(0, 0, 400, 500)); |
copy = display_modes; |
@@ -1021,8 +1021,8 @@ TEST_P(DisplayManagerTest, ResolutionFallback) { |
} |
{ |
// Best resolution should find itself on the resolutions list. |
- test::SetDisplayResolution(display_manager(), display_id, |
- gfx::Size(800, 300)); |
+ display::test::SetDisplayResolution(display_manager(), display_id, |
+ gfx::Size(800, 300)); |
display::ManagedDisplayInfo new_native_display_info = |
CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1000, 500)); |
display::ManagedDisplayInfo::ManagedDisplayModeList copy = display_modes; |
@@ -1093,7 +1093,7 @@ TEST_P(DisplayManagerTest, Rotate) { |
// set rotations should be applied. |
UpdateDisplay("200x200, 200x200"); |
const int64_t internal_display_id = |
- test::DisplayManagerTestApi(display_manager()) |
+ display::test::DisplayManagerTestApi(display_manager()) |
.SetFirstDisplayAsInternalDisplay(); |
display_manager()->SetDisplayRotation(internal_display_id, |
@@ -1113,7 +1113,7 @@ TEST_P(DisplayManagerTest, Rotate) { |
display_manager()->OnNativeDisplaysChanged(secondary_only); |
const display::ManagedDisplayInfo& post_removal_info = |
- test::DisplayManagerTestApi(display_manager()) |
+ display::test::DisplayManagerTestApi(display_manager()) |
.GetInternalManagedDisplayInfo(internal_display_id); |
EXPECT_NE(info.GetActiveRotation(), post_removal_info.GetActiveRotation()); |
EXPECT_EQ(display::Display::ROTATE_90, post_removal_info.GetActiveRotation()); |
@@ -1122,7 +1122,7 @@ TEST_P(DisplayManagerTest, Rotate) { |
internal_display_id, display::Display::ROTATE_180, |
display::Display::ROTATION_SOURCE_ACTIVE); |
const display::ManagedDisplayInfo& post_rotation_info = |
- test::DisplayManagerTestApi(display_manager()) |
+ display::test::DisplayManagerTestApi(display_manager()) |
.GetInternalManagedDisplayInfo(internal_display_id); |
EXPECT_NE(info.GetActiveRotation(), post_rotation_info.GetActiveRotation()); |
EXPECT_EQ(display::Display::ROTATE_180, |
@@ -1132,7 +1132,7 @@ TEST_P(DisplayManagerTest, Rotate) { |
// TODO(msw): Broken on Windows. http://crbug.com/584038 |
#if defined(OS_CHROMEOS) |
TEST_P(DisplayManagerTest, UIScale) { |
- test::ScopedDisable125DSFForUIScaling disable; |
+ display::test::ScopedDisable125DSFForUIScaling disable; |
UpdateDisplay("1280x800"); |
int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
@@ -1145,7 +1145,8 @@ TEST_P(DisplayManagerTest, UIScale) { |
display_manager()->SetDisplayUIScale(display_id, 0.625f); |
EXPECT_EQ(1.0f, GetDisplayInfoAt(0).configured_ui_scale()); |
- test::ScopedSetInternalDisplayId set_internal(display_manager(), display_id); |
+ display::test::ScopedSetInternalDisplayId set_internal(display_manager(), |
+ display_id); |
display_manager()->SetDisplayUIScale(display_id, 1.5f); |
EXPECT_EQ(1.0f, GetDisplayInfoAt(0).configured_ui_scale()); |
@@ -1247,7 +1248,8 @@ TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) { |
EXPECT_TRUE(expected_mode->IsEquivalent( |
display_manager()->GetActiveModeForDisplayId(display_id))); |
- test::ScopedSetInternalDisplayId set_internal(display_manager(), display_id); |
+ display::test::ScopedSetInternalDisplayId set_internal(display_manager(), |
+ display_id); |
display_manager()->SetDisplayUIScale(display_id, 1.5f); |
EXPECT_EQ(1.0f, GetDisplayInfoAt(0).configured_ui_scale()); |
@@ -1312,7 +1314,8 @@ TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) { |
TEST_P(DisplayManagerTest, Use125DSFForUIScaling) { |
int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
- test::ScopedSetInternalDisplayId set_internal(display_manager(), display_id); |
+ display::test::ScopedSetInternalDisplayId set_internal(display_manager(), |
+ display_id); |
UpdateDisplay("1920x1080*1.25"); |
EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor()); |
EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveUIScale()); |
@@ -1340,7 +1343,8 @@ TEST_P(DisplayManagerTest, FHD125DefaultsTo08UIScaling) { |
int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
display_id++; |
- test::ScopedSetInternalDisplayId set_internal(display_manager(), display_id); |
+ display::test::ScopedSetInternalDisplayId set_internal(display_manager(), |
+ display_id); |
// Setup the display modes with UI-scale. |
display::ManagedDisplayInfo native_display_info = |
@@ -1372,7 +1376,8 @@ TEST_P(DisplayManagerTest, FHD125DefaultsTo08UIScalingNoOverride) { |
int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
display_id++; |
- test::ScopedSetInternalDisplayId set_internal(display_manager(), display_id); |
+ display::test::ScopedSetInternalDisplayId set_internal(display_manager(), |
+ display_id); |
const gfx::Insets dummy_overscan_insets; |
display_manager()->RegisterDisplayProperty( |
display_id, display::Display::ROTATE_0, 1.0f, &dummy_overscan_insets, |
@@ -1426,8 +1431,8 @@ TEST_P(DisplayManagerTest, ResolutionChangeInUnifiedMode) { |
EXPECT_EQ(1.0f, active_mode->ui_scale()); |
EXPECT_EQ("400x200", active_mode->size().ToString()); |
- EXPECT_TRUE(test::SetDisplayResolution(display_manager(), unified_id, |
- gfx::Size(800, 400))); |
+ EXPECT_TRUE(display::test::SetDisplayResolution(display_manager(), unified_id, |
+ gfx::Size(800, 400))); |
EXPECT_EQ( |
"800x400", |
display::Screen::GetScreen()->GetPrimaryDisplay().size().ToString()); |
@@ -1544,7 +1549,7 @@ TEST_P(DisplayManagerTest, SoftwareMirroring) { |
TestDisplayObserver display_observer; |
display::Screen::GetScreen()->AddObserver(&display_observer); |
- display_manager()->SetMultiDisplayMode(DisplayManager::MIRRORING); |
+ display_manager()->SetMultiDisplayMode(display::DisplayManager::MIRRORING); |
display_manager()->UpdateDisplays(); |
RunAllPendingInMessageLoop(); |
EXPECT_TRUE(display_observer.changed_and_reset()); |
@@ -1617,7 +1622,7 @@ TEST_P(DisplayManagerTest, SingleDisplayToSoftwareMirroring) { |
return; |
UpdateDisplay("600x400"); |
- display_manager()->SetMultiDisplayMode(DisplayManager::MIRRORING); |
+ display_manager()->SetMultiDisplayMode(display::DisplayManager::MIRRORING); |
UpdateDisplay("600x400,600x400"); |
EXPECT_TRUE(display_manager()->IsInMirrorMode()); |
@@ -1872,7 +1877,8 @@ TEST_P(DisplayManagerTest, UnifiedDesktopBasic) { |
display_info_list.push_back( |
CreateDisplayInfo(11, gfx::Rect(500, 0, 400, 500))); |
{ |
- test::ScopedSetInternalDisplayId set_internal(display_manager(), 11); |
+ display::test::ScopedSetInternalDisplayId set_internal(display_manager(), |
+ 11); |
display_manager()->OnNativeDisplaysChanged(display_info_list); |
// 500 * 500 / 300 + 400 ~= 1233. |
EXPECT_EQ(gfx::Size(1233, 500), screen->GetPrimaryDisplay().size()); |
@@ -1917,7 +1923,7 @@ TEST_P(DisplayManagerTest, UnifiedDesktopWithHardwareMirroring) { |
// if the displays are configured to use mirroring when running on desktop. |
// This is a workdaround to force the display manager to forget |
// the mirroing layout. |
- display::DisplayIdList list = test::CreateDisplayIdList2(1, 2); |
+ display::DisplayIdList list = display::test::CreateDisplayIdList2(1, 2); |
display::DisplayLayoutBuilder builder( |
display_manager()->layout_store()->GetRegisteredDisplayLayout(list)); |
builder.SetMirrored(false); |
@@ -2140,7 +2146,7 @@ TEST_P(DisplayManagerTest, DockMode) { |
display_info_list.push_back(external_display_info); |
display_manager()->OnNativeDisplaysChanged(display_info_list); |
const int64_t internal_display_id = |
- test::DisplayManagerTestApi(display_manager()) |
+ display::test::DisplayManagerTestApi(display_manager()) |
.SetFirstDisplayAsInternalDisplay(); |
EXPECT_EQ(internal_id, internal_display_id); |
@@ -2161,7 +2167,7 @@ TEST_P(DisplayManagerTest, DockMode) { |
TEST_P(DisplayManagerTest, DontRegisterBadConfig) { |
if (!SupportsMultipleDisplays()) |
return; |
- display::DisplayIdList list = ash::test::CreateDisplayIdList2(1, 2); |
+ display::DisplayIdList list = display::test::CreateDisplayIdList2(1, 2); |
display::DisplayLayoutBuilder builder(1); |
builder.AddDisplayPlacement(2, 1, display::DisplayPlacement::LEFT, 0); |
builder.AddDisplayPlacement(3, 1, display::DisplayPlacement::BOTTOM, 0); |
@@ -2254,7 +2260,7 @@ TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf100Internal) { |
} |
TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf125Internal) { |
- test::ScopedDisable125DSFForUIScaling disable; |
+ display::test::ScopedDisable125DSFForUIScaling disable; |
FontTestHelper helper(1.25f, FontTestHelper::INTERNAL); |
ASSERT_DOUBLE_EQ( |
1.25f, |
@@ -2351,7 +2357,8 @@ TEST_P(DisplayManagerTest, RejectInvalidLayoutData) { |
good_builder.SetSecondaryPlacement(id2, display::DisplayPlacement::LEFT, 0); |
std::unique_ptr<display::DisplayLayout> good(good_builder.Build()); |
- display::DisplayIdList good_list = test::CreateDisplayIdList2(id1, id2); |
+ display::DisplayIdList good_list = |
+ display::test::CreateDisplayIdList2(id1, id2); |
layout_store->RegisterLayoutForDisplayIdList(good_list, good->Copy()); |
display::DisplayLayoutBuilder bad(id1); |
@@ -2376,7 +2383,7 @@ TEST_P(DisplayManagerTest, GuessDisplayIdFieldsInDisplayLayout) { |
old_layout->primary_id = id1; |
display::DisplayLayoutStore* layout_store = display_manager()->layout_store(); |
- display::DisplayIdList list = test::CreateDisplayIdList2(id1, id2); |
+ display::DisplayIdList list = display::test::CreateDisplayIdList2(id1, id2); |
layout_store->RegisterLayoutForDisplayIdList(list, std::move(old_layout)); |
const display::DisplayLayout& stored = |
layout_store->GetRegisteredDisplayLayout(list); |