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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 tap.x = point.x(); | 530 tap.x = point.x(); |
531 tap.y = point.y(); | 531 tap.y = point.y(); |
532 tap.modifiers = modifiers; | 532 tap.modifiers = modifiers; |
533 RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::From( | 533 RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::From( |
534 web_contents->GetRenderViewHost()->GetWidget()); | 534 web_contents->GetRenderViewHost()->GetWidget()); |
535 widget_host->ForwardGestureEvent(tap); | 535 widget_host->ForwardGestureEvent(tap); |
536 } | 536 } |
537 | 537 |
538 #if defined(USE_AURA) | 538 #if defined(USE_AURA) |
539 void SimulateTouchPressAt(WebContents* web_contents, const gfx::Point& point) { | 539 void SimulateTouchPressAt(WebContents* web_contents, const gfx::Point& point) { |
540 ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, point, 0, base::TimeDelta()); | 540 ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, point, 0, base::TimeTicks()); |
541 static_cast<RenderWidgetHostViewAura*>( | 541 static_cast<RenderWidgetHostViewAura*>( |
542 web_contents->GetRenderWidgetHostView()) | 542 web_contents->GetRenderWidgetHostView()) |
543 ->OnTouchEvent(&touch); | 543 ->OnTouchEvent(&touch); |
544 } | 544 } |
545 #endif | 545 #endif |
546 | 546 |
547 void SimulateKeyPress(WebContents* web_contents, | 547 void SimulateKeyPress(WebContents* web_contents, |
548 ui::KeyboardCode key_code, | 548 ui::KeyboardCode key_code, |
549 bool control, | 549 bool control, |
550 bool shift, | 550 bool shift, |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1242 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1243 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) | 1243 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) |
1244 return ack_result_; | 1244 return ack_result_; |
1245 base::RunLoop run_loop; | 1245 base::RunLoop run_loop; |
1246 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1246 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1247 run_loop.Run(); | 1247 run_loop.Run(); |
1248 return ack_result_; | 1248 return ack_result_; |
1249 } | 1249 } |
1250 | 1250 |
1251 } // namespace content | 1251 } // namespace content |
OLD | NEW |