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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 1845723002: Allow unified desktop for 3+ displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « ash/display/display_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index 7e98711d4e56913229e318ccebdeacc057ec5a2a..88cb314af1cd3db9ea142d0c56b43a2e7b852ce9 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -1700,22 +1700,22 @@ TEST_F(DisplayManagerTest, UnifiedDesktopBasic) {
gfx::Screen* screen = gfx::Screen::GetScreen();
// The 2nd display is scaled so that it has the same height as 1st display.
// 300 * 500 / 200 + 400 = 1150.
- EXPECT_EQ("1150x500", screen->GetPrimaryDisplay().size().ToString());
+ EXPECT_EQ(gfx::Size(1150, 500), screen->GetPrimaryDisplay().size());
display_manager()->SetMirrorMode(true);
- EXPECT_EQ("400x500", screen->GetPrimaryDisplay().size().ToString());
+ EXPECT_EQ(gfx::Size(400, 500), screen->GetPrimaryDisplay().size());
display_manager()->SetMirrorMode(false);
- EXPECT_EQ("1150x500", screen->GetPrimaryDisplay().size().ToString());
+ EXPECT_EQ(gfx::Size(1150, 500), screen->GetPrimaryDisplay().size());
// Switch to single desktop.
UpdateDisplay("500x300");
- EXPECT_EQ("500x300", screen->GetPrimaryDisplay().size().ToString());
+ EXPECT_EQ(gfx::Size(500, 300), screen->GetPrimaryDisplay().size());
// Switch to unified desktop.
UpdateDisplay("500x300,400x500");
// 400 * 300 / 500 + 500 ~= 739.
- EXPECT_EQ("739x300", screen->GetPrimaryDisplay().size().ToString());
+ EXPECT_EQ(gfx::Size(739, 300), screen->GetPrimaryDisplay().size());
// The default should fit to the internal display.
std::vector<DisplayInfo> display_info_list;
@@ -1726,13 +1726,21 @@ TEST_F(DisplayManagerTest, UnifiedDesktopBasic) {
test::ScopedSetInternalDisplayId set_internal(11);
display_manager()->OnNativeDisplaysChanged(display_info_list);
// 500 * 500 / 300 + 400 ~= 1233.
- EXPECT_EQ("1233x500", screen->GetPrimaryDisplay().size().ToString());
+ EXPECT_EQ(gfx::Size(1233, 500), screen->GetPrimaryDisplay().size());
}
+ // Switch to 3 displays.
+ UpdateDisplay("500x300,400x500,500x300");
+ EXPECT_EQ(gfx::Size(1239, 300), screen->GetPrimaryDisplay().size());
+
// Switch back to extended desktop.
display_manager()->SetUnifiedDesktopEnabled(false);
- EXPECT_EQ("500x300", screen->GetPrimaryDisplay().size().ToString());
- EXPECT_EQ("400x500", ScreenUtil::GetSecondaryDisplay().size().ToString());
+ EXPECT_EQ(gfx::Size(500, 300), screen->GetPrimaryDisplay().size());
+ EXPECT_EQ(gfx::Size(400, 500), ScreenUtil::GetSecondaryDisplay().size());
+ EXPECT_EQ(gfx::Size(500, 300),
+ display_manager()
+ ->GetDisplayForId(ScreenUtil::GetSecondaryDisplay().id() + 1)
+ .size());
}
TEST_F(DisplayManagerTest, UnifiedDesktopWithHardwareMirroring) {
« no previous file with comments | « ash/display/display_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698