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

Unified Diff: chrome/browser/ui/views/toolbar/reload_button_unittest.cc

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 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: chrome/browser/ui/views/toolbar/reload_button_unittest.cc
diff --git a/chrome/browser/ui/views/toolbar/reload_button_unittest.cc b/chrome/browser/ui/views/toolbar/reload_button_unittest.cc
index 87579af18f913baae1ea9849a8f6a0b8910f9a94..83bca00b2e2bcb10bd4c44ea2e41e1a72c8107d4 100644
--- a/chrome/browser/ui/views/toolbar/reload_button_unittest.cc
+++ b/chrome/browser/ui/views/toolbar/reload_button_unittest.cc
@@ -58,8 +58,9 @@ TEST_F(ReloadButtonTest, Basic) {
false);
// Press the button. This should start the double-click timer.
- ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
+ 0, 0, ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
reload_.ButtonPressed(&reload_, e);
CheckState(true, ReloadButton::MODE_RELOAD, ReloadButton::MODE_RELOAD, true,
false);
@@ -78,8 +79,9 @@ TEST_F(ReloadButtonTest, Basic) {
TEST_F(ReloadButtonTest, DoubleClickTimer) {
// Start by pressing the button.
- ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
+ 0, 0, ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
reload_.ButtonPressed(&reload_, e);
// Try to press the button again. This should do nothing because the timer is
@@ -105,8 +107,9 @@ TEST_F(ReloadButtonTest, DoubleClickTimer) {
TEST_F(ReloadButtonTest, DisableOnHover) {
// Change to stop and hover.
- ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
+ 0, 0, ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
reload_.ButtonPressed(&reload_, e);
reload_.ChangeMode(ReloadButton::MODE_STOP, false);
set_mouse_hovered(true);
@@ -119,8 +122,9 @@ TEST_F(ReloadButtonTest, DisableOnHover) {
// Un-hover the button, which should allow it to reset.
set_mouse_hovered(false);
- ui::MouseEvent e2(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent e2(
+ ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 0,
+ 0, ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
reload_.OnMouseExited(e2);
CheckState(true, ReloadButton::MODE_RELOAD, ReloadButton::MODE_RELOAD, false,
false);
@@ -128,8 +132,9 @@ TEST_F(ReloadButtonTest, DisableOnHover) {
TEST_F(ReloadButtonTest, ResetOnClick) {
// Change to stop and hover.
- ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
+ 0, 0, ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
reload_.ButtonPressed(&reload_, e);
reload_.ChangeMode(ReloadButton::MODE_STOP, false);
set_mouse_hovered(true);
@@ -143,8 +148,9 @@ TEST_F(ReloadButtonTest, ResetOnClick) {
TEST_F(ReloadButtonTest, ResetOnTimer) {
// Change to stop, hover, and change back to reload.
- ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
+ 0, 0, ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
reload_.ButtonPressed(&reload_, e);
reload_.ChangeMode(ReloadButton::MODE_STOP, false);
set_mouse_hovered(true);

Powered by Google App Engine
This is Rietveld 408576698