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

Unified Diff: ui/events/test/motion_event_test_utils.cc

Issue 999423003: Set the unique_event_id when converting from TouchEvent to WebTouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « ui/events/test/motion_event_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/test/motion_event_test_utils.cc
diff --git a/ui/events/test/motion_event_test_utils.cc b/ui/events/test/motion_event_test_utils.cc
index 8cf9a7fd23ee1ef1ef9d25075d3748aab046cc0a..fe5b747ee2aaaf4b80578198e575d3134d88b538 100644
--- a/ui/events/test/motion_event_test_utils.cc
+++ b/ui/events/test/motion_event_test_utils.cc
@@ -166,10 +166,15 @@ void MockMotionEvent::ResolvePointers() {
}
}
+void MockMotionEvent::SetPrimaryPointerId(int id) {
+ DCHECK_GT(GetPointerCount(), 0U);
+ pointer(0).id = id;
+}
+
std::string ToString(const MotionEvent& event) {
std::stringstream ss;
ss << "MotionEvent {"
- << "\n ID: " << event.GetId() << "\n Action: " << event.GetAction();
+ << "\n Action: " << event.GetAction();
if (event.GetAction() == MotionEvent::ACTION_POINTER_DOWN ||
event.GetAction() == MotionEvent::ACTION_POINTER_UP)
ss << "\n ActionIndex: " << event.GetActionIndex();
@@ -188,6 +193,7 @@ std::string ToString(const MotionEvent& event) {
DCHECK_GE(pi, 0);
pointer_ids.clear_first_marked_bit();
ss << "{"
+ << "\n PointerId: (" << event.GetPointerId(pi) << ")"
<< "\n Pos: (" << event.GetX(pi) << ", " << event.GetY(pi) << ")"
<< "\n RawPos: (" << event.GetX(pi) << ", " << event.GetY(pi) << ")"
<< "\n Size: (" << event.GetTouchMajor(pi) << ", "
« no previous file with comments | « ui/events/test/motion_event_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698