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

Unified Diff: ui/gfx/mac/coordinate_conversion_unittest.mm

Issue 1280673003: [Mac] Enable MacViews site settings bubble behind --enable-mac-views-dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enabledialogs
Patch Set: Sync Created 5 years, 4 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/mac/coordinate_conversion.h ('K') | « ui/gfx/mac/coordinate_conversion.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mac/coordinate_conversion_unittest.mm
diff --git a/ui/gfx/mac/coordinate_conversion_unittest.mm b/ui/gfx/mac/coordinate_conversion_unittest.mm
index ae4931763c8a212db0fe07e6d1a9c2ca97e7eb58..da568218a658d85b79efaabfb60585e378facc1d 100644
--- a/ui/gfx/mac/coordinate_conversion_unittest.mm
+++ b/ui/gfx/mac/coordinate_conversion_unittest.mm
@@ -105,4 +105,29 @@ TEST_F(MacCoordinateConversionTest, ScreenRectToFromNSRect) {
EXPECT_EQ(gfx_rect.ToString(), ScreenRectFromNSRect(ns_rect).ToString());
tapted 2015/08/11 01:23:20 hm - these ToString() calls are probably unnecessa
jackhou1 2015/08/11 03:09:24 Done.
}
+TEST_F(MacCoordinateConversionTest, ScreenPointToFromNSPoint) {
tapted 2015/08/11 01:23:19 nit: add a boring comment
jackhou1 2015/08/11 03:09:24 Done.
+ Point gfx_point = Point(10, 20);
+ NSPoint ns_point = ScreenPointToNSPoint(gfx_point);
+ EXPECT_NSEQ(NSMakePoint(10, 180), ns_point);
+ EXPECT_EQ(gfx_point, ScreenPointFromNSPoint(ns_point));
+
+ // Window in a screen to the left of the primary screen.
tapted 2015/08/11 01:23:19 Window -> Point (or Coordinate). More below
jackhou1 2015/08/11 03:09:24 Done.
+ gfx_point = Point(-40, 20);
+ ns_point = ScreenPointToNSPoint(gfx_point);
+ EXPECT_NSEQ(NSMakePoint(-40, 180), ns_point);
+ EXPECT_EQ(gfx_point, ScreenPointFromNSPoint(ns_point));
+
+ // Window in a screen below the primary screen.
+ gfx_point = Point(10, 220);
+ ns_point = ScreenPointToNSPoint(gfx_point);
+ EXPECT_NSEQ(NSMakePoint(10, -20), ns_point);
+ EXPECT_EQ(gfx_point, ScreenPointFromNSPoint(ns_point));
+
+ // Window in a screen below and to the left primary screen.
+ gfx_point = Point(-40, 220);
+ ns_point = ScreenPointToNSPoint(gfx_point);
+ EXPECT_NSEQ(NSMakePoint(-40, -20), ns_point);
+ EXPECT_EQ(gfx_point, ScreenPointFromNSPoint(ns_point));
+}
+
} // namespace gfx
« ui/gfx/mac/coordinate_conversion.h ('K') | « ui/gfx/mac/coordinate_conversion.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698