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

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

Issue 1008233002: Add a test for a simulated click on a link on tapping of gesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/browser_test_utils.h ('k') | no next file » | 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/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/process/kill.h" 10 #include "base/process/kill.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 mouse_event.x = point.x(); 401 mouse_event.x = point.x();
402 mouse_event.y = point.y(); 402 mouse_event.y = point.y();
403 web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event); 403 web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
404 } 404 }
405 405
406 void SimulateTapAt(WebContents* web_contents, const gfx::Point& point) { 406 void SimulateTapAt(WebContents* web_contents, const gfx::Point& point) {
407 blink::WebGestureEvent tap; 407 blink::WebGestureEvent tap;
408 tap.type = blink::WebGestureEvent::GestureTap; 408 tap.type = blink::WebGestureEvent::GestureTap;
409 tap.x = point.x(); 409 tap.x = point.x();
410 tap.y = point.y(); 410 tap.y = point.y();
411 tap.modifiers = blink::WebInputEvent::ControlKey;
411 RenderWidgetHostImpl* widget_host = 412 RenderWidgetHostImpl* widget_host =
412 RenderWidgetHostImpl::From(web_contents->GetRenderViewHost()); 413 RenderWidgetHostImpl::From(web_contents->GetRenderViewHost());
413 widget_host->ForwardGestureEvent(tap); 414 widget_host->ForwardGestureEvent(tap);
415 }
416
417 void SimulateTapWithModifiersAt(WebContents* web_contents,
418 unsigned modifiers,
419 const gfx::Point& point) {
420 blink::WebGestureEvent tap;
421 tap.type = blink::WebGestureEvent::GestureTap;
422 tap.x = point.x();
423 tap.y = point.y();
424 tap.modifiers = modifiers;
425 RenderWidgetHostImpl* widget_host =
426 RenderWidgetHostImpl::From(web_contents->GetRenderViewHost());
427 widget_host->ForwardGestureEvent(tap);
414 } 428 }
415 429
416 void SimulateKeyPress(WebContents* web_contents, 430 void SimulateKeyPress(WebContents* web_contents,
417 ui::KeyboardCode key_code, 431 ui::KeyboardCode key_code,
418 bool control, 432 bool control,
419 bool shift, 433 bool shift,
420 bool alt, 434 bool alt,
421 bool command) { 435 bool command) {
422 SimulateKeyPressWithCode( 436 SimulateKeyPressWithCode(
423 web_contents, key_code, NULL, control, shift, alt, command); 437 web_contents, key_code, NULL, control, shift, alt, command);
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 968
955 bool WebContentsAddedObserver::RenderViewCreatedCalled() { 969 bool WebContentsAddedObserver::RenderViewCreatedCalled() {
956 if (child_observer_) { 970 if (child_observer_) {
957 return child_observer_->render_view_created_called_ && 971 return child_observer_->render_view_created_called_ &&
958 child_observer_->main_frame_created_called_; 972 child_observer_->main_frame_created_called_;
959 } 973 }
960 return false; 974 return false;
961 } 975 }
962 976
963 } // namespace content 977 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698