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

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

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: const -> constexpr 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
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_ripple.cc ('k') | ui/views/animation/ink_drop_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8f3ed99ce31259f95a79f26832db6052c169a461 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 of ripple's clip bounds
+ // defined by |clip_insets|.
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
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_ripple.cc ('k') | ui/views/animation/ink_drop_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698