Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: ui/views/controls/button/custom_button_unittest.cc

Issue 1977793006: Pressing spacebar on toolbar buttons triggers the ripple effect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting changes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/menu_button_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4b9ca78c755a973994e19c47c21dad60f8b06bbf 100644
--- a/ui/views/controls/button/custom_button_unittest.cc
+++ b/ui/views/controls/button/custom_button_unittest.cc
@@ -86,7 +86,7 @@ class TestCustomButton : public CustomButton, public ButtonListener {
};
// An InkDropDelegate that keeps track of ink drop visibility.
-class TestInkDropDelegateThatTracksVisibilty : public InkDropDelegate {
+class TestInkDropDelegateThatTracksVisibilty : public TestInkDropDelegate {
public:
TestInkDropDelegateThatTracksVisibilty(bool* ink_shown, bool* ink_hidden)
: ink_shown_(ink_shown), ink_hidden_(ink_hidden) {}
@@ -94,7 +94,8 @@ class TestInkDropDelegateThatTracksVisibilty : public InkDropDelegate {
// InkDropDelegate:
void OnAction(InkDropState state) override {
- switch (state) {
+ TestInkDropDelegate::OnAction(state);
+ switch (GetTargetInkDropState()) {
case InkDropState::ACTION_PENDING:
case InkDropState::ALTERNATE_ACTION_PENDING:
case InkDropState::ACTIVATED:
@@ -448,7 +449,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 +465,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 +480,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
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/menu_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698