OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/auto_reset.h" | 5 #include "base/auto_reset.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/browser/gpu/compositor_util.h" | 8 #include "content/browser/gpu/compositor_util.h" |
9 #include "content/browser/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 state_ = state; | 110 state_ = state; |
111 quit_.Run(); | 111 quit_.Run(); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 // BrowserMessageFilter: | 115 // BrowserMessageFilter: |
116 bool OnMessageReceived(const IPC::Message& message) override { | 116 bool OnMessageReceived(const IPC::Message& message) override { |
117 if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) { | 117 if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) { |
118 InputHostMsg_HandleInputEvent_ACK::Param params; | 118 InputHostMsg_HandleInputEvent_ACK::Param params; |
119 InputHostMsg_HandleInputEvent_ACK::Read(&message, ¶ms); | 119 InputHostMsg_HandleInputEvent_ACK::Read(&message, ¶ms); |
120 WebInputEvent::Type type = get<0>(params).type; | 120 WebInputEvent::Type type = base::get<0>(params).type; |
121 InputEventAckState ack = get<0>(params).state; | 121 InputEventAckState ack = base::get<0>(params).state; |
122 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 122 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
123 base::Bind(&InputEventMessageFilter::ReceivedEventAck, | 123 base::Bind(&InputEventMessageFilter::ReceivedEventAck, |
124 this, type, ack)); | 124 this, type, ack)); |
125 } | 125 } |
126 return false; | 126 return false; |
127 } | 127 } |
128 | 128 |
129 base::Closure quit_; | 129 base::Closure quit_; |
130 WebInputEvent::Type type_; | 130 WebInputEvent::Type type_; |
131 InputEventAckState state_; | 131 InputEventAckState state_; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, | 249 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, |
250 filter()->last_ack_state()); | 250 filter()->last_ack_state()); |
251 | 251 |
252 touch.PressPoint(25, 125); | 252 touch.PressPoint(25, 125); |
253 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); | 253 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); |
254 filter()->WaitForAck(WebInputEvent::TouchStart); | 254 filter()->WaitForAck(WebInputEvent::TouchStart); |
255 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state()); | 255 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state()); |
256 } | 256 } |
257 | 257 |
258 } // namespace content | 258 } // namespace content |
OLD | NEW |