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

Unified Diff: ui/gfx/display_unittest.cc

Issue 11140006: Fix code around display overscan settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
« ui/gfx/display.cc ('K') | « ui/gfx/display.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/display_unittest.cc
diff --git a/ui/gfx/display_unittest.cc b/ui/gfx/display_unittest.cc
index 39a5fb679d67436ef0aedfa77bc2b16fe35790ab..3fa8042751234c30b9d41d29e8a3d3638026eba0 100644
--- a/ui/gfx/display_unittest.cc
+++ b/ui/gfx/display_unittest.cc
@@ -46,4 +46,19 @@ TEST(DisplayTest, Scale) {
EXPECT_EQ("10,10 80x80", display.work_area().ToString());
}
+TEST(DisplayTest, OverscanInsets) {
+ gfx::Display display(0, gfx::Rect(0, 0, 100, 100));
+ display.SetOverscanInsets(gfx::Insets(3, 4, 5, 6));
+ EXPECT_EQ("4,3 90x92", display.bounds_in_pixel().ToString());
+ display.SetOverscanInsets(gfx::Insets(6, 5, 4, 3));
+ EXPECT_EQ("5,6 92x90", display.bounds_in_pixel().ToString());
+
+ gfx::Display hidpi_display(0, gfx::Rect(0, 0, 100, 100));
+ hidpi_display.set_device_scale_factor(2.0f);
+ hidpi_display.SetOverscanInsets(gfx::Insets(3, 4, 5, 6));
+ EXPECT_EQ("8,6 80x84", hidpi_display.bounds_in_pixel().ToString());
+ hidpi_display.SetOverscanInsets(gfx::Insets(6, 5, 4, 3));
+ EXPECT_EQ("10,12 84x80", hidpi_display.bounds_in_pixel().ToString());
+}
+
}
« ui/gfx/display.cc ('K') | « ui/gfx/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698