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

Unified Diff: ui/app_list/views/speech_view_unittest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 9 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/app_list/views/speech_view_unittest.cc
diff --git a/ui/app_list/views/speech_view_unittest.cc b/ui/app_list/views/speech_view_unittest.cc
index 122e934c094750da7d24409d7ec35b7d9a6f2edc..18d5c3df70be1e8d3b255e49a848af0b22518116 100644
--- a/ui/app_list/views/speech_view_unittest.cc
+++ b/ui/app_list/views/speech_view_unittest.cc
@@ -58,12 +58,16 @@ TEST_F(SpeechViewTest, ClickMicButton) {
gfx::Rect screen_bounds(view()->mic_button()->GetBoundsInScreen());
// Simulate a mouse click in the center of the MicButton.
- ui::MouseEvent press(ui::ET_MOUSE_PRESSED, screen_bounds.CenterPoint(),
- screen_bounds.CenterPoint(), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON, 0);
- ui::MouseEvent release(ui::ET_MOUSE_RELEASED, screen_bounds.CenterPoint(),
- screen_bounds.CenterPoint(), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON, 0);
+ ui::MouseEvent press(
+ ui::ET_MOUSE_PRESSED, screen_bounds.CenterPoint(),
+ screen_bounds.CenterPoint(), ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
+ ui::MouseEvent release(
+ ui::ET_MOUSE_RELEASED, screen_bounds.CenterPoint(),
+ screen_bounds.CenterPoint(), ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
widget()->OnMouseEvent(&press);
widget()->OnMouseEvent(&release);
EXPECT_EQ(1, GetStopSpeechRecognitionCountAndReset());
@@ -73,10 +77,14 @@ TEST_F(SpeechViewTest, ClickMicButton) {
// circular hit-test mask).
gfx::Point bottom_right(screen_bounds.right() - 1,
screen_bounds.bottom() - 2);
- press = ui::MouseEvent(ui::ET_MOUSE_PRESSED, bottom_right, bottom_right,
- ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0);
- release = ui::MouseEvent(ui::ET_MOUSE_RELEASED, bottom_right, bottom_right,
- ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0);
+ press = ui::MouseEvent(
+ ui::ET_MOUSE_PRESSED, bottom_right, bottom_right, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
+ release = ui::MouseEvent(
+ ui::ET_MOUSE_RELEASED, bottom_right, bottom_right, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
widget()->OnMouseEvent(&press);
widget()->OnMouseEvent(&release);
EXPECT_EQ(0, GetStopSpeechRecognitionCountAndReset());

Powered by Google App Engine
This is Rietveld 408576698