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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 tap.x = point.x(); | 543 tap.x = point.x(); |
544 tap.y = point.y(); | 544 tap.y = point.y(); |
545 tap.modifiers = modifiers; | 545 tap.modifiers = modifiers; |
546 RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::From( | 546 RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::From( |
547 web_contents->GetRenderViewHost()->GetWidget()); | 547 web_contents->GetRenderViewHost()->GetWidget()); |
548 widget_host->ForwardGestureEvent(tap); | 548 widget_host->ForwardGestureEvent(tap); |
549 } | 549 } |
550 | 550 |
551 #if defined(USE_AURA) | 551 #if defined(USE_AURA) |
552 void SimulateTouchPressAt(WebContents* web_contents, const gfx::Point& point) { | 552 void SimulateTouchPressAt(WebContents* web_contents, const gfx::Point& point) { |
553 ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, point, 0, base::TimeDelta()); | 553 ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, point, 0, base::TimeTicks()); |
554 static_cast<RenderWidgetHostViewAura*>( | 554 static_cast<RenderWidgetHostViewAura*>( |
555 web_contents->GetRenderWidgetHostView()) | 555 web_contents->GetRenderWidgetHostView()) |
556 ->OnTouchEvent(&touch); | 556 ->OnTouchEvent(&touch); |
557 } | 557 } |
558 #endif | 558 #endif |
559 | 559 |
560 void SimulateKeyPress(WebContents* web_contents, | 560 void SimulateKeyPress(WebContents* web_contents, |
561 ui::KeyboardCode key_code, | 561 ui::KeyboardCode key_code, |
562 bool control, | 562 bool control, |
563 bool shift, | 563 bool shift, |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1258 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1259 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) | 1259 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) |
1260 return ack_result_; | 1260 return ack_result_; |
1261 base::RunLoop run_loop; | 1261 base::RunLoop run_loop; |
1262 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1262 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1263 run_loop.Run(); | 1263 run_loop.Run(); |
1264 return ack_result_; | 1264 return ack_result_; |
1265 } | 1265 } |
1266 | 1266 |
1267 } // namespace content | 1267 } // namespace content |
OLD | NEW |