| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 0.5 * (ui::GestureConfiguration:: | 298 0.5 * (ui::GestureConfiguration:: |
| 299 min_touch_down_duration_in_seconds_for_click() + | 299 min_touch_down_duration_in_seconds_for_click() + |
| 300 ui::GestureConfiguration:: | 300 ui::GestureConfiguration:: |
| 301 max_touch_down_duration_in_seconds_for_click()); | 301 max_touch_down_duration_in_seconds_for_click()); |
| 302 SyntheticWebTouchEvent touch; | 302 SyntheticWebTouchEvent touch; |
| 303 // Set the timestamp to the base::TimeDelta representing the current time. | 303 // Set the timestamp to the base::TimeDelta representing the current time. |
| 304 touch.SetTimestamp(base::TimeTicks::Now() - base::TimeTicks()); | 304 touch.SetTimestamp(base::TimeTicks::Now() - base::TimeTicks()); |
| 305 touch.PressPoint(point.x(), point.y()); | 305 touch.PressPoint(point.x(), point.y()); |
| 306 RenderWidgetHostImpl* widget_host = | 306 RenderWidgetHostImpl* widget_host = |
| 307 RenderWidgetHostImpl::From(web_contents->GetRenderViewHost()); | 307 RenderWidgetHostImpl::From(web_contents->GetRenderViewHost()); |
| 308 widget_host->ForwardTouchEvent(touch); | 308 widget_host->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); |
| 309 touch.timeStampSeconds += kTapDurationSeconds; | 309 touch.timeStampSeconds += kTapDurationSeconds; |
| 310 touch.ReleasePoint(0); | 310 touch.ReleasePoint(0); |
| 311 widget_host->ForwardTouchEvent(touch); | 311 widget_host->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void SimulateKeyPress(WebContents* web_contents, | 314 void SimulateKeyPress(WebContents* web_contents, |
| 315 ui::KeyboardCode key_code, | 315 ui::KeyboardCode key_code, |
| 316 bool control, | 316 bool control, |
| 317 bool shift, | 317 bool shift, |
| 318 bool alt, | 318 bool alt, |
| 319 bool command) { | 319 bool command) { |
| 320 SimulateKeyPressWithCode( | 320 SimulateKeyPressWithCode( |
| 321 web_contents, key_code, NULL, control, shift, alt, command); | 321 web_contents, key_code, NULL, control, shift, alt, command); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 } | 727 } |
| 728 // The queue should not be empty, unless we were quit because of a timeout. | 728 // The queue should not be empty, unless we were quit because of a timeout. |
| 729 if (message_queue_.empty()) | 729 if (message_queue_.empty()) |
| 730 return false; | 730 return false; |
| 731 *message = message_queue_.front(); | 731 *message = message_queue_.front(); |
| 732 message_queue_.pop(); | 732 message_queue_.pop(); |
| 733 return true; | 733 return true; |
| 734 } | 734 } |
| 735 | 735 |
| 736 } // namespace content | 736 } // namespace content |
| OLD | NEW |