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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 11818008: Automatically set the overscan insets if the output has the flag and no preference is set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 33645a2431d2e0906c8f9177b3230c71eda9ed94..09b4ab05a33f0ce76371c31e30a691b7a53b355a 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -514,5 +514,33 @@ TEST_F(DisplayManagerTest, NativeDisplaysChangedAfterPrimaryChange) {
EXPECT_EQ("0,0 100x100", FindDisplayForId(10).bounds().ToString());
}
+TEST_F(DisplayManagerTest, AutomaticOverscanInsets) {
+ UpdateDisplay("200x200,400x400");
+
+ std::vector<gfx::Display> displays;
+ displays.push_back(*display_manager()->GetDisplayAt(0));
+ displays.push_back(*display_manager()->GetDisplayAt(1));
+ int64 id = displays[1].id();
+ display_manager()->SetHasOverscanFlagForTest(id, true);
+
+ display_manager()->OnNativeDisplaysChanged(displays);
+ // It has overscan insets, although SetOverscanInsets() isn't called.
+ EXPECT_EQ("11,211 380x380",
+ display_manager()->GetDisplayAt(1)->bounds_in_pixel().ToString());
+
+ // If custom overscan insets is specified, the specified value is used.
+ display_manager()->SetOverscanInsets(id, gfx::Insets(5, 6, 7, 8));
+ display_manager()->OnNativeDisplaysChanged(displays);
+ EXPECT_EQ("7,206 386x388",
+ display_manager()->GetDisplayAt(1)->bounds_in_pixel().ToString());
+
+ // Do not overscan even though it has 'has_overscan' flag, if the custom
+ // insets is empty.
+ display_manager()->SetOverscanInsets(id, gfx::Insets());
+ display_manager()->OnNativeDisplaysChanged(displays);
+ EXPECT_EQ("1,201 400x400",
+ display_manager()->GetDisplayAt(1)->bounds_in_pixel().ToString());
+}
+
} // namespace internal
} // namespace ash
« 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