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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <tuple> | 9 #include <tuple> |
10 | 10 |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 575 |
576 void SimulateMouseMove(int x, int y, int modifiers) { | 576 void SimulateMouseMove(int x, int y, int modifiers) { |
577 SimulateMouseEvent(WebInputEvent::MouseMove, x, y, modifiers, false); | 577 SimulateMouseEvent(WebInputEvent::MouseMove, x, y, modifiers, false); |
578 } | 578 } |
579 | 579 |
580 void SimulateMouseEvent( | 580 void SimulateMouseEvent( |
581 WebInputEvent::Type type, int x, int y, int modifiers, bool pressed) { | 581 WebInputEvent::Type type, int x, int y, int modifiers, bool pressed) { |
582 WebMouseEvent event = | 582 WebMouseEvent event = |
583 SyntheticWebMouseEventBuilder::Build(type, x, y, modifiers); | 583 SyntheticWebMouseEventBuilder::Build(type, x, y, modifiers); |
584 if (pressed) | 584 if (pressed) |
585 event.button = WebMouseEvent::ButtonLeft; | 585 event.button = WebMouseEvent::Button::Left; |
586 event.timeStampSeconds = GetNextSimulatedEventTimeSeconds(); | 586 event.timeStampSeconds = GetNextSimulatedEventTimeSeconds(); |
587 host_->ForwardMouseEvent(event); | 587 host_->ForwardMouseEvent(event); |
588 } | 588 } |
589 | 589 |
590 // Inject simple synthetic WebGestureEvent instances. | 590 // Inject simple synthetic WebGestureEvent instances. |
591 void SimulateGestureEvent(WebInputEvent::Type type, | 591 void SimulateGestureEvent(WebInputEvent::Type type, |
592 WebGestureDevice sourceDevice) { | 592 WebGestureDevice sourceDevice) { |
593 host_->ForwardGestureEvent( | 593 host_->ForwardGestureEvent( |
594 SyntheticWebGestureEventBuilder::Build(type, sourceDevice)); | 594 SyntheticWebGestureEventBuilder::Build(type, sourceDevice)); |
595 } | 595 } |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 ui::LatencyInfo()); | 1700 ui::LatencyInfo()); |
1701 | 1701 |
1702 | 1702 |
1703 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). | 1703 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). |
1704 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); | 1704 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); |
1705 | 1705 |
1706 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); | 1706 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); |
1707 } | 1707 } |
1708 | 1708 |
1709 } // namespace content | 1709 } // namespace content |
OLD | NEW |