| OLD | NEW |
| 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 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
| 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
| 7 | 7 |
| 8 #include "ui/views/animation/ink_drop_animation.h" |
| 9 |
| 10 #include <memory> |
| 11 |
| 8 #include "base/macros.h" | 12 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/views/animation/flood_fill_ink_drop_animation.h" | 15 #include "ui/views/animation/flood_fill_ink_drop_animation.h" |
| 13 #include "ui/views/animation/ink_drop_animation.h" | |
| 14 #include "ui/views/animation/ink_drop_animation_observer.h" | 16 #include "ui/views/animation/ink_drop_animation_observer.h" |
| 15 #include "ui/views/animation/ink_drop_state.h" | 17 #include "ui/views/animation/ink_drop_state.h" |
| 16 #include "ui/views/animation/square_ink_drop_animation.h" | 18 #include "ui/views/animation/square_ink_drop_animation.h" |
| 17 #include "ui/views/animation/test/flood_fill_ink_drop_animation_test_api.h" | 19 #include "ui/views/animation/test/flood_fill_ink_drop_animation_test_api.h" |
| 18 #include "ui/views/animation/test/ink_drop_animation_test_api.h" | 20 #include "ui/views/animation/test/ink_drop_animation_test_api.h" |
| 19 #include "ui/views/animation/test/square_ink_drop_animation_test_api.h" | 21 #include "ui/views/animation/test/square_ink_drop_animation_test_api.h" |
| 20 #include "ui/views/animation/test/test_ink_drop_animation_observer.h" | 22 #include "ui/views/animation/test/test_ink_drop_animation_observer.h" |
| 21 | 23 |
| 22 namespace views { | 24 namespace views { |
| 23 namespace test { | 25 namespace test { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 39 // 3. Add the new enum value to the INSTANTIATE_TEST_CASE_P) Values list. | 41 // 3. Add the new enum value to the INSTANTIATE_TEST_CASE_P) Values list. |
| 40 class InkDropAnimationTest | 42 class InkDropAnimationTest |
| 41 : public testing::TestWithParam<InkDropAnimationTestTypes> { | 43 : public testing::TestWithParam<InkDropAnimationTestTypes> { |
| 42 public: | 44 public: |
| 43 InkDropAnimationTest(); | 45 InkDropAnimationTest(); |
| 44 ~InkDropAnimationTest() override; | 46 ~InkDropAnimationTest() override; |
| 45 | 47 |
| 46 protected: | 48 protected: |
| 47 TestInkDropAnimationObserver observer_; | 49 TestInkDropAnimationObserver observer_; |
| 48 | 50 |
| 49 scoped_ptr<InkDropAnimation> ink_drop_animation_; | 51 std::unique_ptr<InkDropAnimation> ink_drop_animation_; |
| 50 | 52 |
| 51 scoped_ptr<InkDropAnimationTestApi> test_api_; | 53 std::unique_ptr<InkDropAnimationTestApi> test_api_; |
| 52 | 54 |
| 53 private: | 55 private: |
| 54 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTest); | 56 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTest); |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 InkDropAnimationTest::InkDropAnimationTest() { | 59 InkDropAnimationTest::InkDropAnimationTest() { |
| 58 switch (GetParam()) { | 60 switch (GetParam()) { |
| 59 case SQUARE_INK_DROP_ANIMATION: { | 61 case SQUARE_INK_DROP_ANIMATION: { |
| 60 SquareInkDropAnimation* square_ink_drop_animation = | 62 SquareInkDropAnimation* square_ink_drop_animation = |
| 61 new SquareInkDropAnimation(gfx::Size(10, 10), 2, gfx::Size(8, 8), 1, | 63 new SquareInkDropAnimation(gfx::Size(10, 10), 2, gfx::Size(8, 8), 1, |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 347 |
| 346 EXPECT_EQ(2, observer_.last_animation_ended_ordinal()); | 348 EXPECT_EQ(2, observer_.last_animation_ended_ordinal()); |
| 347 EXPECT_EQ(views::InkDropState::HIDDEN, | 349 EXPECT_EQ(views::InkDropState::HIDDEN, |
| 348 observer_.target_state_at_last_animation_ended()); | 350 observer_.target_state_at_last_animation_ended()); |
| 349 } | 351 } |
| 350 | 352 |
| 351 } // namespace test | 353 } // namespace test |
| 352 } // namespace views | 354 } // namespace views |
| 353 | 355 |
| 354 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 356 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
| OLD | NEW |