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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 void ReleaseTouchPoint(int index) { | 649 void ReleaseTouchPoint(int index) { |
650 CHECK(index >= 0 && index < touch_event_.touchesLengthCap); | 650 CHECK(index >= 0 && index < touch_event_.touchesLengthCap); |
651 touch_event_.touches[index].state = WebKit::WebTouchPoint::StateReleased; | 651 touch_event_.touches[index].state = WebKit::WebTouchPoint::StateReleased; |
652 touch_event_.type = WebInputEvent::TouchEnd; | 652 touch_event_.type = WebInputEvent::TouchEnd; |
653 } | 653 } |
654 | 654 |
655 const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) { | 655 const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) { |
656 PickleIterator iter(message); | 656 PickleIterator iter(message); |
657 const char* data; | 657 const char* data; |
658 int data_length; | 658 int data_length; |
| 659 int64 input_number; |
| 660 if (!message.ReadInt64(&iter, &input_number)) |
| 661 return NULL; |
659 if (!message.ReadData(&iter, &data, &data_length)) | 662 if (!message.ReadData(&iter, &data, &data_length)) |
660 return NULL; | 663 return NULL; |
661 return reinterpret_cast<const WebInputEvent*>(data); | 664 return reinterpret_cast<const WebInputEvent*>(data); |
662 } | 665 } |
663 | 666 |
664 MessageLoopForUI message_loop_; | 667 MessageLoopForUI message_loop_; |
665 | 668 |
666 scoped_ptr<TestBrowserContext> browser_context_; | 669 scoped_ptr<TestBrowserContext> browser_context_; |
667 RenderWidgetHostProcess* process_; // Deleted automatically by the widget. | 670 RenderWidgetHostProcess* process_; // Deleted automatically by the widget. |
668 scoped_ptr<MockRenderWidgetHostDelegate> delegate_; | 671 scoped_ptr<MockRenderWidgetHostDelegate> delegate_; |
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3256 EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); | 3259 EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); |
3257 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); | 3260 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); |
3258 | 3261 |
3259 SendInputEventACK(WebKit::WebInputEvent::GestureScrollEnd, false); | 3262 SendInputEventACK(WebKit::WebInputEvent::GestureScrollEnd, false); |
3260 EXPECT_EQ(0U, process_->sink().message_count()); | 3263 EXPECT_EQ(0U, process_->sink().message_count()); |
3261 EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); | 3264 EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); |
3262 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); | 3265 EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize()); |
3263 } | 3266 } |
3264 | 3267 |
3265 } // namespace content | 3268 } // namespace content |
OLD | NEW |