OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |