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

Side by Side Diff: content/public/test/render_view_test.cc

Issue 715733002: [Android] Show autofill popup after animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 11 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
« no previous file with comments | « content/public/test/render_view_test.h ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/public/test/render_view_test.h" 5 #include "content/public/test/render_view_test.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/common/dom_storage/dom_storage_types.h" 8 #include "content/common/dom_storage/dom_storage_types.h"
9 #include "content/common/frame_messages.h" 9 #include "content/common/frame_messages.h"
10 #include "content/common/input_messages.h" 10 #include "content/common/input_messages.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return gfx::Rect(); 315 return gfx::Rect();
316 coords.push_back(value->Int32Value()); 316 coords.push_back(value->Int32Value());
317 } 317 }
318 return gfx::Rect(coords[0], coords[1], coords[2], coords[3]); 318 return gfx::Rect(coords[0], coords[1], coords[2], coords[3]);
319 } 319 }
320 320
321 bool RenderViewTest::SimulateElementClick(const std::string& element_id) { 321 bool RenderViewTest::SimulateElementClick(const std::string& element_id) {
322 gfx::Rect bounds = GetElementBounds(element_id); 322 gfx::Rect bounds = GetElementBounds(element_id);
323 if (bounds.IsEmpty()) 323 if (bounds.IsEmpty())
324 return false; 324 return false;
325 SimulatePointClick(bounds.CenterPoint());
326 return true;
327 }
328
329 void RenderViewTest::SimulatePointClick(const gfx::Point& point) {
325 WebMouseEvent mouse_event; 330 WebMouseEvent mouse_event;
326 mouse_event.type = WebInputEvent::MouseDown; 331 mouse_event.type = WebInputEvent::MouseDown;
327 mouse_event.button = WebMouseEvent::ButtonLeft; 332 mouse_event.button = WebMouseEvent::ButtonLeft;
328 mouse_event.x = bounds.CenterPoint().x(); 333 mouse_event.x = point.x();
329 mouse_event.y = bounds.CenterPoint().y(); 334 mouse_event.y = point.y();
330 mouse_event.clickCount = 1; 335 mouse_event.clickCount = 1;
331 scoped_ptr<IPC::Message> input_message(
332 new InputMsg_HandleInputEvent(0, &mouse_event, ui::LatencyInfo(), false));
333 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 336 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
334 impl->OnMessageReceived(*input_message); 337 impl->OnMessageReceived(
335 return true; 338 InputMsg_HandleInputEvent(0, &mouse_event, ui::LatencyInfo(), false));
339 mouse_event.type = WebInputEvent::MouseUp;
340 impl->OnMessageReceived(
341 InputMsg_HandleInputEvent(0, &mouse_event, ui::LatencyInfo(), false));
336 } 342 }
337 343
338 void RenderViewTest::SetFocused(const blink::WebNode& node) { 344 void RenderViewTest::SetFocused(const blink::WebNode& node) {
339 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 345 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
340 impl->focusedNodeChanged(node); 346 impl->focusedNodeChanged(node);
341 } 347 }
342 348
343 void RenderViewTest::Reload(const GURL& url) { 349 void RenderViewTest::Reload(const GURL& url) {
344 FrameMsg_Navigate_Params params; 350 FrameMsg_Navigate_Params params;
345 params.common_params.url = url; 351 params.common_params.url = url;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), 439 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(),
434 navigate_params); 440 navigate_params);
435 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); 441 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message);
436 442
437 // The load actually happens asynchronously, so we pump messages to process 443 // The load actually happens asynchronously, so we pump messages to process
438 // the pending continuation. 444 // the pending continuation.
439 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); 445 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait();
440 } 446 }
441 447
442 } // namespace content 448 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/render_view_test.h ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698