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

Unified Diff: ui/gfx/point_unittest.cc

Issue 11369144: ui: Make gfx::Point::Scale() mutate the class, similar to gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for aura Created 8 years, 1 month 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
« cc/layer_impl.cc ('K') | « ui/gfx/point_f.cc ('k') | ui/gfx/quad_f.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/point_unittest.cc
diff --git a/ui/gfx/point_unittest.cc b/ui/gfx/point_unittest.cc
index 3a58e07fe2edbaddf50473e42a91bf170dc996a9..e76bdb5dbcb331a393cfb91d93cac487408a076e 100644
--- a/ui/gfx/point_unittest.cc
+++ b/ui/gfx/point_unittest.cc
@@ -98,4 +98,26 @@ TEST(PointTest, ToRoundedPoint) {
EXPECT_EQ(Point(-11, -11), ToRoundedPoint(PointF(-10.9999f, -10.9999f)));
}
+TEST(PointTest, Scale) {
+ EXPECT_EQ(PointF().ToString(), ScalePoint(Point(), 2).ToString());
+ EXPECT_EQ(PointF().ToString(), ScalePoint(Point(), 2, 2).ToString());
+
+ EXPECT_EQ(PointF(2, -2).ToString(),
+ ScalePoint(Point(1, -1), 2).ToString());
+ EXPECT_EQ(PointF(2, -2).ToString(),
+ ScalePoint(Point(1, -1), 2, 2).ToString());
+
+ PointF zero;
+ PointF one(1, -1);
+
+ zero.Scale(2);
+ zero.Scale(3, 1.5);
+
+ one.Scale(2);
+ one.Scale(3, 1.5);
+
+ EXPECT_EQ(PointF().ToString(), zero.ToString());
+ EXPECT_EQ(PointF(6, -3).ToString(), one.ToString());
+}
+
} // namespace gfx
« cc/layer_impl.cc ('K') | « ui/gfx/point_f.cc ('k') | ui/gfx/quad_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698