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

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

Issue 250923005: Touch emulator: overwrite timestamps from mouse event with current time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 TEST_F(TouchEmulatorTest, Touch) { 197 TEST_F(TouchEmulatorTest, Touch) {
198 MouseMove(100, 200); 198 MouseMove(100, 200);
199 EXPECT_EQ("", ExpectedEvents()); 199 EXPECT_EQ("", ExpectedEvents());
200 MouseDown(100, 200); 200 MouseDown(100, 200);
201 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); 201 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents());
202 MouseUp(200, 200); 202 MouseUp(200, 200);
203 EXPECT_EQ( 203 EXPECT_EQ(
204 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate" 204 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate"
205 " TouchEnd GestureScrollEnd", 205 " TouchEnd GestureFlingStart",
206 ExpectedEvents()); 206 ExpectedEvents());
207 } 207 }
208 208
209 TEST_F(TouchEmulatorTest, MultipleTouches) { 209 TEST_F(TouchEmulatorTest, MultipleTouches) {
210 MouseMove(100, 200); 210 MouseMove(100, 200);
211 EXPECT_EQ("", ExpectedEvents()); 211 EXPECT_EQ("", ExpectedEvents());
212 MouseDown(100, 200); 212 MouseDown(100, 200);
213 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); 213 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents());
214 MouseUp(200, 200); 214 MouseUp(200, 200);
215 EXPECT_EQ( 215 EXPECT_EQ(
216 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate" 216 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate"
217 " TouchEnd GestureScrollEnd", 217 " TouchEnd GestureFlingStart",
218 ExpectedEvents()); 218 ExpectedEvents());
219 MouseMove(300, 200); 219 MouseMove(300, 200);
220 MouseMove(200, 200); 220 MouseMove(200, 200);
221 EXPECT_EQ("", ExpectedEvents()); 221 EXPECT_EQ("", ExpectedEvents());
222 MouseDown(300, 200); 222 MouseDown(300, 200);
223 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); 223 EXPECT_EQ("TouchStart GestureFlingCancel GestureTapDown", ExpectedEvents());
224 MouseDrag(300, 300); 224 MouseDrag(300, 300);
225 EXPECT_EQ( 225 EXPECT_EQ(
226 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate", 226 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate",
227 ExpectedEvents()); 227 ExpectedEvents());
228 MouseDrag(300, 400); 228 MouseDrag(300, 400);
229 EXPECT_EQ("TouchMove GestureScrollUpdate", ExpectedEvents()); 229 EXPECT_EQ("TouchMove GestureScrollUpdate", ExpectedEvents());
230 MouseUp(300, 500); 230 MouseUp(300, 500);
231 EXPECT_EQ( 231 EXPECT_EQ(
232 "TouchMove GestureScrollUpdate TouchEnd GestureScrollEnd", 232 "TouchMove GestureScrollUpdate TouchEnd GestureScrollEnd",
233 ExpectedEvents()); 233 ExpectedEvents());
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 EXPECT_EQ( 311 EXPECT_EQ(
312 "TouchMove GestureScrollUpdate", 312 "TouchMove GestureScrollUpdate",
313 ExpectedEvents()); 313 ExpectedEvents());
314 MouseUp(400, 200); 314 MouseUp(400, 200);
315 EXPECT_EQ( 315 EXPECT_EQ(
316 "TouchEnd GestureScrollEnd", 316 "TouchEnd GestureScrollEnd",
317 ExpectedEvents()); 317 ExpectedEvents());
318 } 318 }
319 319
320 } // namespace content 320 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698