OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
8 #include "base/timer.h" | 8 #include "base/timer.h" |
9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
10 #include "content/browser/renderer_host/backing_store.h" | 10 #include "content/browser/renderer_host/backing_store.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 SimulateGestureEventCore(WebInputEvent::GestureScrollUpdate, | 580 SimulateGestureEventCore(WebInputEvent::GestureScrollUpdate, |
581 WebGestureEvent::Touchscreen, &gesture_event); | 581 WebGestureEvent::Touchscreen, &gesture_event); |
582 } | 582 } |
583 | 583 |
584 // Inject synthetic GestureFlingStart events. | 584 // Inject synthetic GestureFlingStart events. |
585 void SimulateGestureFlingStartEvent( | 585 void SimulateGestureFlingStartEvent( |
586 float velocityX, | 586 float velocityX, |
587 float velocityY, | 587 float velocityY, |
588 WebGestureEvent::SourceDevice sourceDevice) { | 588 WebGestureEvent::SourceDevice sourceDevice) { |
589 WebGestureEvent gesture_event; | 589 WebGestureEvent gesture_event; |
590 // FIXME(mohsen || rjkroege): Remove following line after removing uses of | |
591 // flingStart.sourceDevice in WebKit, but before removing the field itself. | |
592 gesture_event.data.flingStart.sourceDevice = sourceDevice; | |
593 gesture_event.data.flingStart.velocityX = velocityX; | 590 gesture_event.data.flingStart.velocityX = velocityX; |
594 gesture_event.data.flingStart.velocityY = velocityY; | 591 gesture_event.data.flingStart.velocityY = velocityY; |
595 SimulateGestureEventCore(WebInputEvent::GestureFlingStart, sourceDevice, | 592 SimulateGestureEventCore(WebInputEvent::GestureFlingStart, sourceDevice, |
596 &gesture_event); | 593 &gesture_event); |
597 } | 594 } |
598 | 595 |
599 // Set the timestamp for the touch-event. | 596 // Set the timestamp for the touch-event. |
600 void SetTouchTimestamp(base::TimeDelta timestamp) { | 597 void SetTouchTimestamp(base::TimeDelta timestamp) { |
601 touch_event_.timeStampSeconds = timestamp.InSecondsF(); | 598 touch_event_.timeStampSeconds = timestamp.InSecondsF(); |
602 } | 599 } |
(...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3256 EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); | 3253 EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); |
3257 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); | 3254 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); |
3258 | 3255 |
3259 SendInputEventACK(WebKit::WebInputEvent::GestureScrollEnd, false); | 3256 SendInputEventACK(WebKit::WebInputEvent::GestureScrollEnd, false); |
3260 EXPECT_EQ(0U, process_->sink().message_count()); | 3257 EXPECT_EQ(0U, process_->sink().message_count()); |
3261 EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); | 3258 EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); |
3262 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); | 3259 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); |
3263 } | 3260 } |
3264 | 3261 |
3265 } // namespace content | 3262 } // namespace content |
OLD | NEW |