| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 scoped_ptr<InkDropAnimationTestApi> test_api_; | 46 scoped_ptr<InkDropAnimationTestApi> test_api_; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTest); | 49 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTest); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 InkDropAnimationTest::InkDropAnimationTest() { | 52 InkDropAnimationTest::InkDropAnimationTest() { |
| 53 switch (GetParam()) { | 53 switch (GetParam()) { |
| 54 case SQUARE_INK_DROP_ANIMATION: { | 54 case SQUARE_INK_DROP_ANIMATION: { |
| 55 SquareInkDropAnimation* typed_ink_drop_animation = | 55 SquareInkDropAnimation* typed_ink_drop_animation = |
| 56 new SquareInkDropAnimation(gfx::Size(10, 10), 2, gfx::Size(8, 8), 1); | 56 new SquareInkDropAnimation(gfx::Size(10, 10), 2, gfx::Size(8, 8), 1, |
| 57 gfx::Point(), SK_ColorBLACK); |
| 57 ink_drop_animation_.reset(typed_ink_drop_animation); | 58 ink_drop_animation_.reset(typed_ink_drop_animation); |
| 58 test_api_.reset( | 59 test_api_.reset( |
| 59 new SquareInkDropAnimationTestApi(typed_ink_drop_animation)); | 60 new SquareInkDropAnimationTestApi(typed_ink_drop_animation)); |
| 60 break; | 61 break; |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 ink_drop_animation_->AddObserver(&observer_); | 64 ink_drop_animation_->set_observer(&observer_); |
| 64 observer_.set_ink_drop_animation(ink_drop_animation_.get()); | 65 observer_.set_ink_drop_animation(ink_drop_animation_.get()); |
| 65 test_api_->SetDisableAnimationTimers(true); | 66 test_api_->SetDisableAnimationTimers(true); |
| 66 } | 67 } |
| 67 | 68 |
| 68 InkDropAnimationTest::~InkDropAnimationTest() {} | 69 InkDropAnimationTest::~InkDropAnimationTest() {} |
| 69 | 70 |
| 70 // Note: First argument is optional and intentionally left blank. | 71 // Note: First argument is optional and intentionally left blank. |
| 71 // (it's a prefix for the generated test cases) | 72 // (it's a prefix for the generated test cases) |
| 72 INSTANTIATE_TEST_CASE_P(, | 73 INSTANTIATE_TEST_CASE_P(, |
| 73 InkDropAnimationTest, | 74 InkDropAnimationTest, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 281 |
| 281 EXPECT_EQ(2, observer_.last_animation_ended_ordinal()); | 282 EXPECT_EQ(2, observer_.last_animation_ended_ordinal()); |
| 282 EXPECT_EQ(views::InkDropState::HIDDEN, | 283 EXPECT_EQ(views::InkDropState::HIDDEN, |
| 283 observer_.target_state_at_last_animation_ended()); | 284 observer_.target_state_at_last_animation_ended()); |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace test | 287 } // namespace test |
| 287 } // namespace views | 288 } // namespace views |
| 288 | 289 |
| 289 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 290 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
| OLD | NEW |