Chromium Code Reviews| Index: ui/views/controls/button/custom_button_unittest.cc |
| diff --git a/ui/views/controls/button/custom_button_unittest.cc b/ui/views/controls/button/custom_button_unittest.cc |
| index 1f9388ce49532dd16e6ae6538f3d29fc4fd814a0..5550d8a0fb50ec4f9621cd76527965a7f3f522e9 100644 |
| --- a/ui/views/controls/button/custom_button_unittest.cc |
| +++ b/ui/views/controls/button/custom_button_unittest.cc |
| @@ -94,7 +94,8 @@ class TestInkDropDelegateThatTracksVisibilty : public InkDropDelegate { |
| // InkDropDelegate: |
| void OnAction(InkDropState state) override { |
| - switch (state) { |
| + state_ = state; |
| + switch (state_) { |
| case InkDropState::ACTION_PENDING: |
| case InkDropState::ALTERNATE_ACTION_PENDING: |
| case InkDropState::ACTIVATED: |
| @@ -114,9 +115,12 @@ class TestInkDropDelegateThatTracksVisibilty : public InkDropDelegate { |
| void SetHovered(bool is_hovered) override {} |
| + InkDropState GetTargetInkDropState() const override { return state_; } |
|
bruthig
2016/05/14 00:17:24
Can you update TestInkDropDelegateThatTracksVisibi
|
| + |
| private: |
| bool* ink_shown_; |
| bool* ink_hidden_; |
| + InkDropState state_; |
| DISALLOW_COPY_AND_ASSIGN(TestInkDropDelegateThatTracksVisibilty); |
| }; |
| @@ -448,7 +452,7 @@ TEST_F(CustomButtonTest, HideInkDropWhenShowingContextMenu) { |
| button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE); |
| EXPECT_FALSE(ink_drop_delegate->is_hovered()); |
| - EXPECT_EQ(InkDropState::HIDDEN, ink_drop_delegate->state()); |
| + EXPECT_EQ(InkDropState::HIDDEN, ink_drop_delegate->GetTargetInkDropState()); |
| } |
| TEST_F(CustomButtonTest, DontHideInkDropWhenShowingContextMenu) { |
| @@ -464,7 +468,8 @@ TEST_F(CustomButtonTest, DontHideInkDropWhenShowingContextMenu) { |
| button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE); |
| EXPECT_TRUE(ink_drop_delegate->is_hovered()); |
| - EXPECT_EQ(InkDropState::ACTION_PENDING, ink_drop_delegate->state()); |
| + EXPECT_EQ(InkDropState::ACTION_PENDING, |
| + ink_drop_delegate->GetTargetInkDropState()); |
| } |
| TEST_F(CustomButtonTest, InkDropAfterTryingToShowContextMenu) { |
| @@ -478,7 +483,8 @@ TEST_F(CustomButtonTest, InkDropAfterTryingToShowContextMenu) { |
| button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE); |
| EXPECT_TRUE(ink_drop_delegate->is_hovered()); |
| - EXPECT_EQ(InkDropState::ACTION_PENDING, ink_drop_delegate->state()); |
| + EXPECT_EQ(InkDropState::ACTION_PENDING, |
| + ink_drop_delegate->GetTargetInkDropState()); |
| } |
| } // namespace views |