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

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

Issue 2603373002: Show/hide ink drop highlight when button enable state changes. (Closed)
Patch Set: Created 3 years, 12 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
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 889bc7beb6c5884dacba696d5cebb56f0433c80d..1425641559b085b38a43dddfcd383d4d2180de41 100644
--- a/ui/views/controls/button/custom_button_unittest.cc
+++ b/ui/views/controls/button/custom_button_unittest.cc
@@ -465,6 +465,19 @@ TEST_F(CustomButtonTest, HideInkDropOnBlur) {
EXPECT_TRUE(button()->pressed());
}
+TEST_F(CustomButtonTest, HideInkDropHighlightOnDisable) {
+ TestInkDrop* ink_drop = new TestInkDrop();
+ CreateButtonWithInkDrop(base::WrapUnique(ink_drop), false);
+
+ ui::test::EventGenerator generator(widget()->GetNativeWindow());
+ generator.MoveMouseToInHost(10, 10);
+ EXPECT_TRUE(ink_drop->is_hovered());
+ button()->SetEnabled(false);
+ EXPECT_FALSE(ink_drop->is_hovered());
+ button()->SetEnabled(true);
+ EXPECT_TRUE(ink_drop->is_hovered());
+}
+
TEST_F(CustomButtonTest, InkDropAfterTryingToShowContextMenu) {
TestInkDrop* ink_drop = new TestInkDrop();
CreateButtonWithInkDrop(base::WrapUnique(ink_drop), false);
« ui/views/controls/button/custom_button.cc ('K') | « 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