| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/test/test_mock_time_task_runner.h" | 8 #include "base/test/test_mock_time_task_runner.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 InkDropTest, | 80 InkDropTest, |
| 81 testing::Values(INK_DROP_STUB, INK_DROP_IMPL)); | 81 testing::Values(INK_DROP_STUB, INK_DROP_IMPL)); |
| 82 | 82 |
| 83 TEST_P(InkDropTest, | 83 TEST_P(InkDropTest, |
| 84 VerifyInkDropLayersRemovedAfterDestructionWhenRippleIsActive) { | 84 VerifyInkDropLayersRemovedAfterDestructionWhenRippleIsActive) { |
| 85 ink_drop_->AnimateToState(InkDropState::ACTION_PENDING); | 85 ink_drop_->AnimateToState(InkDropState::ACTION_PENDING); |
| 86 ink_drop_.reset(); | 86 ink_drop_.reset(); |
| 87 EXPECT_EQ(0, test_ink_drop_host_.num_ink_drop_layers()); | 87 EXPECT_EQ(0, test_ink_drop_host_.num_ink_drop_layers()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 TEST_P(InkDropTest, | |
| 91 VerifyInkDropLayersRemovedAfterDestructionWhenHoverIsActive) { | |
| 92 test_ink_drop_host_.set_should_show_highlight(true); | |
| 93 ink_drop_->SetHovered(true); | |
| 94 ink_drop_.reset(); | |
| 95 EXPECT_EQ(0, test_ink_drop_host_.num_ink_drop_layers()); | |
| 96 } | |
| 97 | |
| 98 TEST_P(InkDropTest, StateIsHiddenInitially) { | 90 TEST_P(InkDropTest, StateIsHiddenInitially) { |
| 99 EXPECT_EQ(InkDropState::HIDDEN, ink_drop_->GetTargetInkDropState()); | 91 EXPECT_EQ(InkDropState::HIDDEN, ink_drop_->GetTargetInkDropState()); |
| 100 } | 92 } |
| 101 | 93 |
| 102 TEST_P(InkDropTest, TypicalQuickAction) { | 94 TEST_P(InkDropTest, TypicalQuickAction) { |
| 103 ink_drop_->AnimateToState(InkDropState::ACTION_PENDING); | 95 ink_drop_->AnimateToState(InkDropState::ACTION_PENDING); |
| 104 ink_drop_->AnimateToState(InkDropState::ACTION_TRIGGERED); | 96 ink_drop_->AnimateToState(InkDropState::ACTION_TRIGGERED); |
| 105 EXPECT_EQ(InkDropState::HIDDEN, ink_drop_->GetTargetInkDropState()); | 97 EXPECT_EQ(InkDropState::HIDDEN, ink_drop_->GetTargetInkDropState()); |
| 106 } | 98 } |
| 107 | 99 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 135 TEST_P(InkDropTest, TypicalSlowActivated) { | 127 TEST_P(InkDropTest, TypicalSlowActivated) { |
| 136 ink_drop_->AnimateToState(InkDropState::ACTION_PENDING); | 128 ink_drop_->AnimateToState(InkDropState::ACTION_PENDING); |
| 137 ink_drop_->AnimateToState(InkDropState::ALTERNATE_ACTION_PENDING); | 129 ink_drop_->AnimateToState(InkDropState::ALTERNATE_ACTION_PENDING); |
| 138 ink_drop_->AnimateToState(InkDropState::ACTIVATED); | 130 ink_drop_->AnimateToState(InkDropState::ACTIVATED); |
| 139 ink_drop_->AnimateToState(InkDropState::DEACTIVATED); | 131 ink_drop_->AnimateToState(InkDropState::DEACTIVATED); |
| 140 EXPECT_EQ(InkDropState::HIDDEN, ink_drop_->GetTargetInkDropState()); | 132 EXPECT_EQ(InkDropState::HIDDEN, ink_drop_->GetTargetInkDropState()); |
| 141 } | 133 } |
| 142 | 134 |
| 143 } // namespace test | 135 } // namespace test |
| 144 } // namespace views | 136 } // namespace views |
| OLD | NEW |