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

Unified Diff: ui/gfx/geometry/rect_unittest.cc

Issue 1328283003: Avoid implicit conversion from Rect to RectF in events and gfx tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/rect_unittest.cc
diff --git a/ui/gfx/geometry/rect_unittest.cc b/ui/gfx/geometry/rect_unittest.cc
index 7c2e058b472068f4d5b841771877b57f5620c619..0ecde65c91b373ec5b0d47938e6cf36bedc2e1d4 100644
--- a/ui/gfx/geometry/rect_unittest.cc
+++ b/ui/gfx/geometry/rect_unittest.cc
@@ -455,7 +455,7 @@ TEST(RectTest, ScaleRect) {
};
for (size_t i = 0; i < arraysize(tests); ++i) {
- Rect r1(tests[i].x1, tests[i].y1, tests[i].w1, tests[i].h1);
+ RectF r1(tests[i].x1, tests[i].y1, tests[i].w1, tests[i].h1);
RectF r2(tests[i].x2, tests[i].y2, tests[i].w2, tests[i].h2);
RectF scaled = ScaleRect(r1, tests[i].scale);
@@ -705,15 +705,12 @@ TEST(RectTest, ConstructAndAssign) {
#endif
TEST(RectTest, ToRectF) {
- // Check that implicit conversion from integer to float compiles.
+ // Check that explicit conversion from integer to float compiles.
Rect a(10, 20, 30, 40);
RectF b(10, 20, 30, 40);
- RectF intersect = IntersectRects(a, b);
- EXPECT_EQ(b, intersect);
-
- EXPECT_EQ(a, b);
- EXPECT_EQ(b, a);
+ RectF c = RectF(a);
+ EXPECT_EQ(b, c);
}
TEST(RectTest, BoundingRect) {
« no previous file with comments | « ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698