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

Side by Side Diff: ui/views/rect_based_targeting_utils_unittest.cc

Issue 823133004: Cleanup: Update the path to gfx rect headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rect_f.h Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « ui/views/rect_based_targeting_utils.cc ('k') | ui/views/round_rect_painter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/rect_based_targeting_utils.h" 5 #include "ui/views/rect_based_targeting_utils.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/rect.h" 8 #include "ui/gfx/geometry/rect.h"
9 9
10 namespace views { 10 namespace views {
11 11
12 TEST(RectBasedTargetingUtils, UsePointBasedTargeting) { 12 TEST(RectBasedTargetingUtils, UsePointBasedTargeting) {
13 gfx::Rect rect_1(gfx::Point(-22, 30), gfx::Size(1, 1)); 13 gfx::Rect rect_1(gfx::Point(-22, 30), gfx::Size(1, 1));
14 gfx::Rect rect_2(gfx::Point(0, 0), gfx::Size(34, 55)); 14 gfx::Rect rect_2(gfx::Point(0, 0), gfx::Size(34, 55));
15 gfx::Rect rect_3(gfx::Point(12, 12), gfx::Size(1, 0)); 15 gfx::Rect rect_3(gfx::Point(12, 12), gfx::Size(1, 0));
16 gfx::Rect rect_4(gfx::Point(12, 120), gfx::Size(0, 0)); 16 gfx::Rect rect_4(gfx::Point(12, 120), gfx::Size(0, 0));
17 17
18 EXPECT_TRUE(UsePointBasedTargeting(rect_1)); 18 EXPECT_TRUE(UsePointBasedTargeting(rect_1));
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 EXPECT_EQ(0, DistanceSquaredFromCenterToPoint(point_1, rect_1)); 61 EXPECT_EQ(0, DistanceSquaredFromCenterToPoint(point_1, rect_1));
62 EXPECT_EQ(1225, DistanceSquaredFromCenterToPoint(point_2, rect_2)); 62 EXPECT_EQ(1225, DistanceSquaredFromCenterToPoint(point_2, rect_2));
63 EXPECT_EQ(3025, DistanceSquaredFromCenterToPoint(point_1, rect_2)); 63 EXPECT_EQ(3025, DistanceSquaredFromCenterToPoint(point_1, rect_2));
64 EXPECT_EQ(1025, DistanceSquaredFromCenterToPoint(point_2, rect_3)); 64 EXPECT_EQ(1025, DistanceSquaredFromCenterToPoint(point_2, rect_3));
65 EXPECT_EQ(2501, DistanceSquaredFromCenterToPoint(point_3, rect_2)); 65 EXPECT_EQ(2501, DistanceSquaredFromCenterToPoint(point_3, rect_2));
66 EXPECT_EQ(136, DistanceSquaredFromCenterToPoint(point_3, rect_1)); 66 EXPECT_EQ(136, DistanceSquaredFromCenterToPoint(point_3, rect_1));
67 EXPECT_EQ(980, DistanceSquaredFromCenterToPoint(point_4, rect_3)); 67 EXPECT_EQ(980, DistanceSquaredFromCenterToPoint(point_4, rect_3));
68 } 68 }
69 69
70 } // namespace views 70 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/rect_based_targeting_utils.cc ('k') | ui/views/round_rect_painter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698