| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 base::Closure quit_; | 124 base::Closure quit_; |
| 125 WebInputEvent::Type type_; | 125 WebInputEvent::Type type_; |
| 126 InputEventAckState state_; | 126 InputEventAckState state_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(InputEventMessageFilter); | 128 DISALLOW_COPY_AND_ASSIGN(InputEventMessageFilter); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 class TouchInputBrowserTest : public ContentBrowserTest { | 131 class TouchInputBrowserTest : public ContentBrowserTest { |
| 132 public: | 132 public: |
| 133 TouchInputBrowserTest() {} | 133 TouchInputBrowserTest() {} |
| 134 virtual ~TouchInputBrowserTest() {} | 134 ~TouchInputBrowserTest() override {} |
| 135 | 135 |
| 136 RenderWidgetHostImpl* GetWidgetHost() { | 136 RenderWidgetHostImpl* GetWidgetHost() { |
| 137 return RenderWidgetHostImpl::From(shell()->web_contents()-> | 137 return RenderWidgetHostImpl::From(shell()->web_contents()-> |
| 138 GetRenderViewHost()); | 138 GetRenderViewHost()); |
| 139 } | 139 } |
| 140 | 140 |
| 141 InputEventMessageFilter* filter() { return filter_.get(); } | 141 InputEventMessageFilter* filter() { return filter_.get(); } |
| 142 | 142 |
| 143 protected: | 143 protected: |
| 144 void LoadURLAndAddFilter() { | 144 void LoadURLAndAddFilter() { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, | 244 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, |
| 245 filter()->last_ack_state()); | 245 filter()->last_ack_state()); |
| 246 | 246 |
| 247 touch.PressPoint(25, 125); | 247 touch.PressPoint(25, 125); |
| 248 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); | 248 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); |
| 249 filter()->WaitForAck(WebInputEvent::TouchStart); | 249 filter()->WaitForAck(WebInputEvent::TouchStart); |
| 250 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state()); | 250 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state()); |
| 251 } | 251 } |
| 252 | 252 |
| 253 } // namespace content | 253 } // namespace content |
| OLD | NEW |