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/render_view_test.h" | 5 #include "content/public/test/render_view_test.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 } | 423 } |
424 | 424 |
425 void RenderViewTest::SimulateRectTap(const gfx::Rect& rect) { | 425 void RenderViewTest::SimulateRectTap(const gfx::Rect& rect) { |
426 WebGestureEvent gesture_event; | 426 WebGestureEvent gesture_event; |
427 gesture_event.x = rect.CenterPoint().x(); | 427 gesture_event.x = rect.CenterPoint().x(); |
428 gesture_event.y = rect.CenterPoint().y(); | 428 gesture_event.y = rect.CenterPoint().y(); |
429 gesture_event.data.tap.tapCount = 1; | 429 gesture_event.data.tap.tapCount = 1; |
430 gesture_event.data.tap.width = rect.width(); | 430 gesture_event.data.tap.width = rect.width(); |
431 gesture_event.data.tap.height = rect.height(); | 431 gesture_event.data.tap.height = rect.height(); |
432 gesture_event.type = WebInputEvent::GestureTap; | 432 gesture_event.type = WebInputEvent::GestureTap; |
| 433 gesture_event.sourceDevice = blink::WebGestureDeviceTouchpad; |
433 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 434 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
434 impl->OnMessageReceived( | 435 impl->OnMessageReceived( |
435 InputMsg_HandleInputEvent(0, &gesture_event, ui::LatencyInfo())); | 436 InputMsg_HandleInputEvent(0, &gesture_event, ui::LatencyInfo())); |
436 impl->FocusChangeComplete(); | 437 impl->FocusChangeComplete(); |
437 } | 438 } |
438 | 439 |
439 void RenderViewTest::SetFocused(const blink::WebNode& node) { | 440 void RenderViewTest::SetFocused(const blink::WebNode& node) { |
440 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 441 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
441 impl->focusedNodeChanged(blink::WebNode(), node); | 442 impl->focusedNodeChanged(blink::WebNode(), node); |
442 } | 443 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 TestRenderFrame* frame = | 590 TestRenderFrame* frame = |
590 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 591 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
591 frame->Navigate(common_params, StartNavigationParams(), request_params); | 592 frame->Navigate(common_params, StartNavigationParams(), request_params); |
592 | 593 |
593 // The load actually happens asynchronously, so we pump messages to process | 594 // The load actually happens asynchronously, so we pump messages to process |
594 // the pending continuation. | 595 // the pending continuation. |
595 FrameLoadWaiter(frame).Wait(); | 596 FrameLoadWaiter(frame).Wait(); |
596 } | 597 } |
597 | 598 |
598 } // namespace content | 599 } // namespace content |
OLD | NEW |