| 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 #include "ui/views/animation/ink_drop_hover.h" | 5 #include "ui/views/animation/ink_drop_hover.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 10 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 InkDropHoverTest::InkDropHoverTest() { | 31 InkDropHoverTest::InkDropHoverTest() { |
| 32 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 32 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
| 33 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 33 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 InkDropHoverTest::~InkDropHoverTest() {} | 36 InkDropHoverTest::~InkDropHoverTest() {} |
| 37 | 37 |
| 38 scoped_ptr<InkDropHover> InkDropHoverTest::CreateInkDropHover() const { | 38 scoped_ptr<InkDropHover> InkDropHoverTest::CreateInkDropHover() const { |
| 39 return make_scoped_ptr(new InkDropHover(gfx::Size(10, 10), 3)); | 39 return make_scoped_ptr( |
| 40 new InkDropHover(gfx::Size(10, 10), 3, gfx::Point(), SK_ColorBLACK)); |
| 40 } | 41 } |
| 41 | 42 |
| 42 TEST_F(InkDropHoverTest, InitialStateAfterConstruction) { | 43 TEST_F(InkDropHoverTest, InitialStateAfterConstruction) { |
| 43 scoped_ptr<InkDropHover> ink_drop_hover = CreateInkDropHover(); | 44 scoped_ptr<InkDropHover> ink_drop_hover = CreateInkDropHover(); |
| 44 EXPECT_FALSE(ink_drop_hover->IsFadingInOrVisible()); | 45 EXPECT_FALSE(ink_drop_hover->IsFadingInOrVisible()); |
| 45 } | 46 } |
| 46 | 47 |
| 47 TEST_F(InkDropHoverTest, IsHoveredStateTransitions) { | 48 TEST_F(InkDropHoverTest, IsHoveredStateTransitions) { |
| 48 scoped_ptr<InkDropHover> ink_drop_hover = CreateInkDropHover(); | 49 scoped_ptr<InkDropHover> ink_drop_hover = CreateInkDropHover(); |
| 49 | 50 |
| 50 ink_drop_hover->FadeIn(base::TimeDelta::FromMilliseconds(0)); | 51 ink_drop_hover->FadeIn(base::TimeDelta::FromMilliseconds(0)); |
| 51 EXPECT_TRUE(ink_drop_hover->IsFadingInOrVisible()); | 52 EXPECT_TRUE(ink_drop_hover->IsFadingInOrVisible()); |
| 52 | 53 |
| 53 ink_drop_hover->FadeOut(base::TimeDelta::FromMilliseconds(0)); | 54 ink_drop_hover->FadeOut(base::TimeDelta::FromMilliseconds(0)); |
| 54 EXPECT_FALSE(ink_drop_hover->IsFadingInOrVisible()); | 55 EXPECT_FALSE(ink_drop_hover->IsFadingInOrVisible()); |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace test | 58 } // namespace test |
| 58 } // namespace views | 59 } // namespace views |
| OLD | NEW |