| 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/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
| 8 #include "base/timer/timer.h" | 8 #include "base/timer/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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 sent_wheel_event_(false), | 138 sent_wheel_event_(false), |
| 139 sent_keyboard_event_(false), | 139 sent_keyboard_event_(false), |
| 140 sent_gesture_event_(false), | 140 sent_gesture_event_(false), |
| 141 send_touch_event_not_cancelled_(false), | 141 send_touch_event_not_cancelled_(false), |
| 142 message_received_(false), | 142 message_received_(false), |
| 143 client_(client) { | 143 client_(client) { |
| 144 } | 144 } |
| 145 virtual ~MockInputRouter() {} | 145 virtual ~MockInputRouter() {} |
| 146 | 146 |
| 147 // InputRouter | 147 // InputRouter |
| 148 virtual void Flush() OVERRIDE { |
| 149 flush_called_ = true; |
| 150 } |
| 148 virtual bool SendInput(IPC::Message* message) OVERRIDE { | 151 virtual bool SendInput(IPC::Message* message) OVERRIDE { |
| 149 send_event_called_ = true; | 152 send_event_called_ = true; |
| 150 | 153 |
| 151 // SendInput takes ownership of message | 154 // SendInput takes ownership of message |
| 152 delete message; | 155 delete message; |
| 153 | 156 |
| 154 return true; | 157 return true; |
| 155 } | 158 } |
| 156 virtual void SendMouseEvent( | 159 virtual void SendMouseEvent( |
| 157 const MouseEventWithLatencyInfo& mouse_event) OVERRIDE { | 160 const MouseEventWithLatencyInfo& mouse_event) OVERRIDE { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 return true; | 199 return true; |
| 197 } | 200 } |
| 198 virtual bool HasQueuedGestureEvents() const OVERRIDE { return true; } | 201 virtual bool HasQueuedGestureEvents() const OVERRIDE { return true; } |
| 199 | 202 |
| 200 // IPC::Listener | 203 // IPC::Listener |
| 201 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | 204 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
| 202 message_received_ = true; | 205 message_received_ = true; |
| 203 return false; | 206 return false; |
| 204 } | 207 } |
| 205 | 208 |
| 209 bool flush_called_; |
| 206 bool send_event_called_; | 210 bool send_event_called_; |
| 207 bool sent_mouse_event_; | 211 bool sent_mouse_event_; |
| 208 bool sent_wheel_event_; | 212 bool sent_wheel_event_; |
| 209 bool sent_keyboard_event_; | 213 bool sent_keyboard_event_; |
| 210 bool sent_gesture_event_; | 214 bool sent_gesture_event_; |
| 211 bool send_touch_event_not_cancelled_; | 215 bool send_touch_event_not_cancelled_; |
| 212 bool message_received_; | 216 bool message_received_; |
| 213 | 217 |
| 214 private: | 218 private: |
| 215 InputRouterClient* client_; | 219 InputRouterClient* client_; |
| (...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2568 | 2572 |
| 2569 TEST_F(RenderWidgetHostTest, InputRouterReceivesHasTouchEventHandlers) { | 2573 TEST_F(RenderWidgetHostTest, InputRouterReceivesHasTouchEventHandlers) { |
| 2570 host_->SetupForInputRouterTest(); | 2574 host_->SetupForInputRouterTest(); |
| 2571 | 2575 |
| 2572 host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true)); | 2576 host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true)); |
| 2573 | 2577 |
| 2574 EXPECT_TRUE(host_->mock_input_router()->message_received_); | 2578 EXPECT_TRUE(host_->mock_input_router()->message_received_); |
| 2575 } | 2579 } |
| 2576 | 2580 |
| 2577 } // namespace content | 2581 } // namespace content |
| OLD | NEW |