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

Unified Diff: ui/app_list/views/speech_view_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: 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 de190fb92d07528315f067b42d145f8445d97612..fa43eb501fd047aa57ad975f4ddd350b8c72aa61 100644
--- a/ui/app_list/views/speech_view_unittest.cc
+++ b/ui/app_list/views/speech_view_unittest.cc
@@ -57,12 +57,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::PointerEventDetails(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::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
widget()->OnMouseEvent(&press);
widget()->OnMouseEvent(&release);
EXPECT_EQ(1, GetToggleSpeechRecognitionCountAndReset());
@@ -72,10 +76,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::PointerEventDetails(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::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
widget()->OnMouseEvent(&press);
widget()->OnMouseEvent(&release);
EXPECT_EQ(0, GetToggleSpeechRecognitionCountAndReset());

Powered by Google App Engine
This is Rietveld 408576698