OLD | NEW |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 aura::Env::DeleteInstance(); | 64 aura::Env::DeleteInstance(); |
65 screen_.reset(); | 65 screen_.reset(); |
66 #endif | 66 #endif |
67 } | 67 } |
68 | 68 |
69 virtual void ForwardGestureEvent( | 69 virtual void ForwardGestureEvent( |
70 const blink::WebGestureEvent& event) OVERRIDE { | 70 const blink::WebGestureEvent& event) OVERRIDE { |
71 forwarded_events_.push_back(event.type); | 71 forwarded_events_.push_back(event.type); |
72 } | 72 } |
73 | 73 |
74 virtual void ForwardTouchEvent( | 74 virtual void ForwardEmulatedTouchEvent( |
75 const blink::WebTouchEvent& event) OVERRIDE { | 75 const blink::WebTouchEvent& event) OVERRIDE { |
76 forwarded_events_.push_back(event.type); | 76 forwarded_events_.push_back(event.type); |
77 EXPECT_EQ(1U, event.touchesLength); | 77 EXPECT_EQ(1U, event.touchesLength); |
78 EXPECT_EQ(last_mouse_x_, event.touches[0].position.x); | 78 EXPECT_EQ(last_mouse_x_, event.touches[0].position.x); |
79 EXPECT_EQ(last_mouse_y_, event.touches[0].position.y); | 79 EXPECT_EQ(last_mouse_y_, event.touches[0].position.y); |
80 int expectedCancelable = event.type != WebInputEvent::TouchCancel; | 80 int expectedCancelable = event.type != WebInputEvent::TouchCancel; |
81 EXPECT_EQ(expectedCancelable, event.cancelable); | 81 EXPECT_EQ(expectedCancelable, event.cancelable); |
82 emulator()->HandleTouchEventAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); | 82 emulator()->HandleTouchEventAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); |
83 } | 83 } |
84 | 84 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); | 340 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); |
341 EXPECT_FALSE(SendMouseWheelEvent()); | 341 EXPECT_FALSE(SendMouseWheelEvent()); |
342 emulator()->Disable(); | 342 emulator()->Disable(); |
343 EXPECT_EQ("TouchCancel GestureTapCancel", ExpectedEvents()); | 343 EXPECT_EQ("TouchCancel GestureTapCancel", ExpectedEvents()); |
344 EXPECT_TRUE(SendMouseWheelEvent()); | 344 EXPECT_TRUE(SendMouseWheelEvent()); |
345 emulator()->Enable(true /* allow_pinch */); | 345 emulator()->Enable(true /* allow_pinch */); |
346 EXPECT_TRUE(SendMouseWheelEvent()); | 346 EXPECT_TRUE(SendMouseWheelEvent()); |
347 } | 347 } |
348 | 348 |
349 } // namespace content | 349 } // namespace content |
OLD | NEW |