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

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

Issue 247433003: Mark touchcancel events as uncancelable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avi CR feedback 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 const blink::WebGestureEvent& event) OVERRIDE { 69 const blink::WebGestureEvent& event) OVERRIDE {
70 forwarded_events_.push_back(event.type); 70 forwarded_events_.push_back(event.type);
71 } 71 }
72 72
73 virtual void ForwardTouchEvent( 73 virtual void ForwardTouchEvent(
74 const blink::WebTouchEvent& event) OVERRIDE { 74 const blink::WebTouchEvent& event) OVERRIDE {
75 forwarded_events_.push_back(event.type); 75 forwarded_events_.push_back(event.type);
76 EXPECT_EQ(1U, event.touchesLength); 76 EXPECT_EQ(1U, event.touchesLength);
77 EXPECT_EQ(last_mouse_x_, event.touches[0].position.x); 77 EXPECT_EQ(last_mouse_x_, event.touches[0].position.x);
78 EXPECT_EQ(last_mouse_y_, event.touches[0].position.y); 78 EXPECT_EQ(last_mouse_y_, event.touches[0].position.y);
79 int expectedCancelable = event.type != WebInputEvent::TouchCancel;
80 EXPECT_EQ(expectedCancelable, event.cancelable);
79 emulator()->HandleTouchEventAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); 81 emulator()->HandleTouchEventAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
80 } 82 }
81 83
82 virtual void SetCursor(const WebCursor& cursor) OVERRIDE {} 84 virtual void SetCursor(const WebCursor& cursor) OVERRIDE {}
83 85
84 protected: 86 protected:
85 TouchEmulator* emulator() const { 87 TouchEmulator* emulator() const {
86 return emulator_.get(); 88 return emulator_.get();
87 } 89 }
88 90
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 EXPECT_EQ( 311 EXPECT_EQ(
310 "TouchMove GestureScrollUpdate", 312 "TouchMove GestureScrollUpdate",
311 ExpectedEvents()); 313 ExpectedEvents());
312 MouseUp(400, 200); 314 MouseUp(400, 200);
313 EXPECT_EQ( 315 EXPECT_EQ(
314 "TouchEnd GestureScrollEnd", 316 "TouchEnd GestureScrollEnd",
315 ExpectedEvents()); 317 ExpectedEvents());
316 } 318 }
317 319
318 } // namespace content 320 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/touch_emulator.cc ('k') | content/browser/renderer_host/input/touch_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698