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

Unified Diff: ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: Created 4 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
Index: ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc
diff --git a/ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc b/ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc
index 91610426d81b5c621b835c6929e31a454fb095a1..ec6fae530ebc02e9b3c831217d8a9bcbfe11f58e 100644
--- a/ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc
+++ b/ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc
@@ -5,7 +5,9 @@
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/point.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/animation/test/flood_fill_ink_drop_ripple_test_api.h"
@@ -13,15 +15,17 @@ namespace views {
namespace test {
TEST(FloodFillInkDropRippleTest, TransformedCenterPointForIrregularClipBounds) {
- const gfx::Rect clip_bounds(8, 9, 32, 32);
+ const gfx::Size host_size(48, 50);
+ const gfx::Insets clip_insets(9, 8);
const gfx::Point requested_center_point(25, 24);
- // |expected_center_point| is in the |clip_bounds| coordinate space.
+ // |expected_center_point| is in the coordinate space defined by
+ // |clip_insets|.
bruthig 2016/11/28 22:13:46 nit: It doesn't really make sense for |clip_insets
mohsen 2016/11/29 00:07:12 Updated comments.
const gfx::Point expected_center_point(
- requested_center_point.x() - clip_bounds.x(),
- requested_center_point.y() - clip_bounds.y());
+ requested_center_point.x() - clip_insets.left(),
+ requested_center_point.y() - clip_insets.top());
- FloodFillInkDropRipple ripple(clip_bounds, requested_center_point,
+ FloodFillInkDropRipple ripple(host_size, clip_insets, requested_center_point,
SK_ColorWHITE, 0.175f);
FloodFillInkDropRippleTestApi test_api(&ripple);
@@ -33,12 +37,13 @@ TEST(FloodFillInkDropRippleTest, TransformedCenterPointForIrregularClipBounds) {
TEST(FloodFillInkDropRippleTest, MaxDistanceToCorners) {
const float kAbsError = 0.01f;
+ const gfx::Size host_size(70, 130);
// Rect with the following corners in clockwise order starting at the origin:
// (10, 30), (60, 30), (10, 100), (60, 100)
- const gfx::Rect clip_bounds(10, 30, 50, 70);
+ const gfx::Insets clip_insets(30, 10);
- FloodFillInkDropRipple ripple(clip_bounds, gfx::Point(), SK_ColorWHITE,
- 0.175f);
+ FloodFillInkDropRipple ripple(host_size, clip_insets, gfx::Point(),
+ SK_ColorWHITE, 0.175f);
FloodFillInkDropRippleTestApi test_api(&ripple);
// Interior points

Powered by Google App Engine
This is Rietveld 408576698