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

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

Issue 1920783003: Fixed Back/Forward buttons to not hide ink drop when long press shows drop down menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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') | no next file » | 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 36d8aadd0d9ed2b97293f23780c7e23741c03d83..c5c7f425c6d38ad99237953f6bb8e5d33058c156 100644
--- a/ui/views/controls/button/custom_button_unittest.cc
+++ b/ui/views/controls/button/custom_button_unittest.cc
@@ -435,11 +435,12 @@ TEST_F(CustomButtonTest, CaptureLossHidesInkDrop) {
button()->state());
}
-TEST_F(CustomButtonTest, InkDropAfterShowingContextMenu) {
+TEST_F(CustomButtonTest, HideInkDropWhenShowingContextMenu) {
TestInkDropDelegate* ink_drop_delegate = new TestInkDropDelegate();
CreateButtonWithInkDrop(base::WrapUnique(ink_drop_delegate));
TestContextMenuController context_menu_controller;
button()->set_context_menu_controller(&context_menu_controller);
+ button()->set_hide_ink_drop_when_showing_context_menu(true);
ink_drop_delegate->SetHovered(true);
ink_drop_delegate->OnAction(InkDropState::ACTION_PENDING);
@@ -450,6 +451,22 @@ TEST_F(CustomButtonTest, InkDropAfterShowingContextMenu) {
EXPECT_EQ(InkDropState::HIDDEN, ink_drop_delegate->state());
}
+TEST_F(CustomButtonTest, DontHideInkDropWhenShowingContextMenu) {
+ TestInkDropDelegate* ink_drop_delegate = new TestInkDropDelegate();
+ CreateButtonWithInkDrop(base::WrapUnique(ink_drop_delegate));
+ TestContextMenuController context_menu_controller;
+ button()->set_context_menu_controller(&context_menu_controller);
+ button()->set_hide_ink_drop_when_showing_context_menu(false);
+
+ ink_drop_delegate->SetHovered(true);
+ ink_drop_delegate->OnAction(InkDropState::ACTION_PENDING);
+
+ button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE);
+
+ EXPECT_TRUE(ink_drop_delegate->is_hovered());
+ EXPECT_EQ(InkDropState::ACTION_PENDING, ink_drop_delegate->state());
+}
+
TEST_F(CustomButtonTest, InkDropAfterTryingToShowContextMenu) {
TestInkDropDelegate* ink_drop_delegate = new TestInkDropDelegate();
CreateButtonWithInkDrop(base::WrapUnique(ink_drop_delegate));
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698