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

Side by Side Diff: ui/views/animation/ink_drop_ripple_unittest.cc

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: const -> constexpr Created 4 years 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/animation/ink_drop_ripple.cc ('k') | ui/views/controls/button/label_button.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/animation/ink_drop_ripple.h" 5 #include "ui/views/animation/ink_drop_ripple.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/gfx/geometry/insets.h"
11 #include "ui/gfx/geometry/size.h" 12 #include "ui/gfx/geometry/size.h"
12 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" 13 #include "ui/views/animation/flood_fill_ink_drop_ripple.h"
13 #include "ui/views/animation/ink_drop_ripple_observer.h" 14 #include "ui/views/animation/ink_drop_ripple_observer.h"
14 #include "ui/views/animation/ink_drop_state.h" 15 #include "ui/views/animation/ink_drop_state.h"
15 #include "ui/views/animation/square_ink_drop_ripple.h" 16 #include "ui/views/animation/square_ink_drop_ripple.h"
16 #include "ui/views/animation/test/flood_fill_ink_drop_ripple_test_api.h" 17 #include "ui/views/animation/test/flood_fill_ink_drop_ripple_test_api.h"
17 #include "ui/views/animation/test/ink_drop_ripple_test_api.h" 18 #include "ui/views/animation/test/ink_drop_ripple_test_api.h"
18 #include "ui/views/animation/test/square_ink_drop_ripple_test_api.h" 19 #include "ui/views/animation/test/square_ink_drop_ripple_test_api.h"
19 #include "ui/views/animation/test/test_ink_drop_ripple_observer.h" 20 #include "ui/views/animation/test/test_ink_drop_ripple_observer.h"
20 21
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 case SQUARE_INK_DROP_RIPPLE: { 61 case SQUARE_INK_DROP_RIPPLE: {
61 SquareInkDropRipple* square_ink_drop_ripple = 62 SquareInkDropRipple* square_ink_drop_ripple =
62 new SquareInkDropRipple(gfx::Size(10, 10), 2, gfx::Size(8, 8), 1, 63 new SquareInkDropRipple(gfx::Size(10, 10), 2, gfx::Size(8, 8), 1,
63 gfx::Point(), SK_ColorBLACK, kVisibleOpacity); 64 gfx::Point(), SK_ColorBLACK, kVisibleOpacity);
64 ink_drop_ripple_.reset(square_ink_drop_ripple); 65 ink_drop_ripple_.reset(square_ink_drop_ripple);
65 test_api_.reset(new SquareInkDropRippleTestApi(square_ink_drop_ripple)); 66 test_api_.reset(new SquareInkDropRippleTestApi(square_ink_drop_ripple));
66 break; 67 break;
67 } 68 }
68 case FLOOD_FILL_INK_DROP_RIPPLE: { 69 case FLOOD_FILL_INK_DROP_RIPPLE: {
69 FloodFillInkDropRipple* flood_fill_ink_drop_ripple = 70 FloodFillInkDropRipple* flood_fill_ink_drop_ripple =
70 new FloodFillInkDropRipple(gfx::Rect(0, 0, 10, 10), gfx::Point(), 71 new FloodFillInkDropRipple(gfx::Size(10, 10), gfx::Point(),
71 SK_ColorBLACK, kVisibleOpacity); 72 SK_ColorBLACK, kVisibleOpacity);
72 ink_drop_ripple_.reset(flood_fill_ink_drop_ripple); 73 ink_drop_ripple_.reset(flood_fill_ink_drop_ripple);
73 test_api_.reset( 74 test_api_.reset(
74 new FloodFillInkDropRippleTestApi(flood_fill_ink_drop_ripple)); 75 new FloodFillInkDropRippleTestApi(flood_fill_ink_drop_ripple));
75 break; 76 break;
76 } 77 }
77 } 78 }
78 ink_drop_ripple_->set_observer(&observer_); 79 ink_drop_ripple_->set_observer(&observer_);
79 observer_.set_ink_drop_ripple(ink_drop_ripple_.get()); 80 observer_.set_ink_drop_ripple(ink_drop_ripple_.get());
80 test_api_->SetDisableAnimationTimers(true); 81 test_api_->SetDisableAnimationTimers(true);
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 353
353 test_api_->CompleteAnimations(); 354 test_api_->CompleteAnimations();
354 355
355 EXPECT_TRUE(observer_.AnimationHasEnded()); 356 EXPECT_TRUE(observer_.AnimationHasEnded());
356 EXPECT_EQ(views::InkDropState::HIDDEN, 357 EXPECT_EQ(views::InkDropState::HIDDEN,
357 observer_.target_state_at_last_animation_ended()); 358 observer_.target_state_at_last_animation_ended());
358 } 359 }
359 360
360 } // namespace test 361 } // namespace test
361 } // namespace views 362 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_ripple.cc ('k') | ui/views/controls/button/label_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698