Chromium Code Reviews| 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 |