Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: content/browser/renderer_host/input/touch_input_browsertest.cc

Issue 1413643002: Separate RenderViewHost from RenderWidgetHost, part 2: public implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/location.h" 7 #include "base/location.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 InputEventMessageFilter* filter() { return filter_.get(); } 147 InputEventMessageFilter* filter() { return filter_.get(); }
148 148
149 protected: 149 protected:
150 void LoadURLAndAddFilter() { 150 void LoadURLAndAddFilter() {
151 const GURL data_url(kTouchEventDataURL); 151 const GURL data_url(kTouchEventDataURL);
152 NavigateToURL(shell(), data_url); 152 NavigateToURL(shell(), data_url);
153 153
154 WebContentsImpl* web_contents = 154 WebContentsImpl* web_contents =
155 static_cast<WebContentsImpl*>(shell()->web_contents()); 155 static_cast<WebContentsImpl*>(shell()->web_contents());
156 RenderWidgetHostImpl* host = 156 RenderWidgetHostImpl* host = RenderWidgetHostImpl::From(
157 RenderWidgetHostImpl::From(web_contents->GetRenderViewHost()); 157 web_contents->GetRenderViewHost()->GetWidget());
158 host->GetView()->SetSize(gfx::Size(400, 400)); 158 host->GetView()->SetSize(gfx::Size(400, 400));
159 159
160 // The page is loaded in the renderer, wait for a new frame to arrive. 160 // The page is loaded in the renderer, wait for a new frame to arrive.
161 while (!host->ScheduleComposite()) 161 while (!host->ScheduleComposite())
162 GiveItSomeTime(); 162 GiveItSomeTime();
163 163
164 filter_ = new InputEventMessageFilter(); 164 filter_ = new InputEventMessageFilter();
165 host->GetProcess()->AddFilter(filter_.get()); 165 host->GetProcess()->AddFilter(filter_.get());
166 } 166 }
167 167
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, 265 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS,
266 filter()->last_ack_state()); 266 filter()->last_ack_state());
267 267
268 touch.PressPoint(25, 125); 268 touch.PressPoint(25, 125);
269 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); 269 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
270 filter()->WaitForAck(WebInputEvent::TouchStart); 270 filter()->WaitForAck(WebInputEvent::TouchStart);
271 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state()); 271 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state());
272 } 272 }
273 273
274 } // namespace content 274 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698