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

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

Issue 2178163002: Add ink drop ripple to shelf overflow button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed scoped task runner Created 4 years, 4 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 01a233c7db9ae3f57d0c292bc32808e63d57bc09..fa5c69f1e703bf358d2f4e52ea5ae86d7d670cc6 100644
--- a/ui/views/controls/button/custom_button_unittest.cc
+++ b/ui/views/controls/button/custom_button_unittest.cc
@@ -253,19 +253,20 @@ TEST_F(CustomButtonTest, NotifyAction) {
}
// Tests that OnClickCanceled gets called when NotifyClick is not expected
-// anymore.
+// anymore (e.g., release happens outside of the button).
TEST_F(CustomButtonTest, NotifyActionNoClick) {
gfx::Point center(10, 10);
+ gfx::Point outside(10 + button()->width(), 10);
// By default the button should notify its listener on mouse release.
button()->OnMousePressed(ui::MouseEvent(
ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(),
- ui::EF_RIGHT_MOUSE_BUTTON, ui::EF_RIGHT_MOUSE_BUTTON));
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON));
EXPECT_FALSE(button()->canceled());
button()->OnMouseReleased(ui::MouseEvent(
- ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(),
- ui::EF_RIGHT_MOUSE_BUTTON, ui::EF_RIGHT_MOUSE_BUTTON));
+ ui::ET_MOUSE_RELEASED, outside, outside, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON));
EXPECT_TRUE(button()->canceled());
// Set the notify action to its listener on mouse press.
@@ -273,15 +274,15 @@ TEST_F(CustomButtonTest, NotifyActionNoClick) {
button()->set_notify_action(CustomButton::NOTIFY_ON_PRESS);
button()->OnMousePressed(ui::MouseEvent(
ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(),
- ui::EF_RIGHT_MOUSE_BUTTON, ui::EF_RIGHT_MOUSE_BUTTON));
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON));
// OnClickCanceled is only sent on mouse release.
EXPECT_FALSE(button()->canceled());
// The button should no longer notify on mouse release.
button()->Reset();
button()->OnMouseReleased(ui::MouseEvent(
- ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(),
- ui::EF_RIGHT_MOUSE_BUTTON, ui::EF_RIGHT_MOUSE_BUTTON));
+ ui::ET_MOUSE_RELEASED, outside, outside, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON));
EXPECT_FALSE(button()->canceled());
}
« ui/views/animation/ink_drop_host_view.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