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

Side by Side Diff: content/browser/renderer_host/input/gesture_text_selector_unittest.cc

Issue 565583005: Clean up GestureEventDetails constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alwasy set oldest_touch_id_ to -1 in the constructor Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/renderer_host/input/gesture_text_selector.h" 10 #include "content/browser/renderer_host/input/gesture_text_selector.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 virtual void LongPress(base::TimeTicks time, float x, float y) OVERRIDE { 55 virtual void LongPress(base::TimeTicks time, float x, float y) OVERRIDE {
56 event_log_.push_back("LongPress"); 56 event_log_.push_back("LongPress");
57 } 57 }
58 58
59 protected: 59 protected:
60 static GestureEventData CreateGesture(ui::EventType type, 60 static GestureEventData CreateGesture(ui::EventType type,
61 base::TimeTicks event_time, 61 base::TimeTicks event_time,
62 float x, 62 float x,
63 float y) { 63 float y) {
64 return GestureEventData(GestureEventDetails(type, 0, 0), 64 return GestureEventData(GestureEventDetails(type),
65 0, 65 0,
66 MotionEvent::TOOL_TYPE_FINGER, 66 MotionEvent::TOOL_TYPE_FINGER,
67 event_time, 67 event_time,
68 x, 68 x,
69 y, 69 y,
70 x, 70 x,
71 y, 71 y,
72 1, 72 1,
73 gfx::RectF(0, 0, 0, 0)); 73 gfx::RectF(0, 0, 0, 0));
74 } 74 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // 4. TAP 222 // 4. TAP
223 event_time += base::TimeDelta::FromMilliseconds(10); 223 event_time += base::TimeDelta::FromMilliseconds(10);
224 const GestureEventData tap = 224 const GestureEventData tap =
225 CreateGesture(ui::ET_GESTURE_TAP, event_time, x1, y1); 225 CreateGesture(ui::ET_GESTURE_TAP, event_time, x1, y1);
226 EXPECT_TRUE(selector_->OnGestureEvent(tap)); 226 EXPECT_TRUE(selector_->OnGestureEvent(tap));
227 EXPECT_EQ(1u, event_log_.size()); // LongPress 227 EXPECT_EQ(1u, event_log_.size()); // LongPress
228 EXPECT_STREQ("LongPress", event_log_.back().c_str()); 228 EXPECT_STREQ("LongPress", event_log_.back().c_str());
229 } 229 }
230 230
231 } // namespace content 231 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698