| 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 ea0898d2da0b05d516fda5080992e3af8bc059b8..7348e492e1eb20407fe552f580c266fe620e9412 100644
|
| --- a/ui/gfx/mac/coordinate_conversion_unittest.mm
|
| +++ b/ui/gfx/mac/coordinate_conversion_unittest.mm
|
| @@ -104,4 +104,30 @@ TEST_F(MacCoordinateConversionTest, ScreenRectToFromNSRect) {
|
| EXPECT_EQ(gfx_rect.ToString(), ScreenRectFromNSRect(ns_rect).ToString());
|
| }
|
|
|
| +// Test point conversion, using the same setup as above.
|
| +TEST_F(MacCoordinateConversionTest, ScreenPointFromNSPoint) {
|
| + Point gfx_point = Point(10, 20);
|
| + NSPoint ns_point = ScreenPointToNSPoint(gfx_point);
|
| + EXPECT_TRUE(NSEqualPoints(NSMakePoint(10, 180), ns_point));
|
| + EXPECT_EQ(gfx_point.ToString(), ScreenPointFromNSPoint(ns_point).ToString());
|
| +
|
| + // Point in a screen to the left of the primary screen.
|
| + gfx_point = Point(-40, 20);
|
| + ns_point = ScreenPointToNSPoint(gfx_point);
|
| + EXPECT_TRUE(NSEqualPoints(NSMakePoint(-40, 180), ns_point));
|
| + EXPECT_EQ(gfx_point.ToString(), ScreenPointFromNSPoint(ns_point).ToString());
|
| +
|
| + // Point in a screen below the primary screen.
|
| + gfx_point = Point(10, 220);
|
| + ns_point = ScreenPointToNSPoint(gfx_point);
|
| + EXPECT_TRUE(NSEqualPoints(NSMakePoint(10, -20), ns_point));
|
| + EXPECT_EQ(gfx_point.ToString(), ScreenPointFromNSPoint(ns_point).ToString());
|
| +
|
| + // Point in a screen below and to the left primary screen.
|
| + gfx_point = Point(-40, 220);
|
| + ns_point = ScreenPointToNSPoint(gfx_point);
|
| + EXPECT_TRUE(NSEqualPoints(NSMakePoint(-40, -20), ns_point));
|
| + EXPECT_EQ(gfx_point.ToString(), ScreenPointFromNSPoint(ns_point).ToString());
|
| +}
|
| +
|
| } // namespace gfx
|
|
|