Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 2227563003: Refactoring button field and its type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac/win errors Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 571
572 void SimulateMouseMove(int x, int y, int modifiers) { 572 void SimulateMouseMove(int x, int y, int modifiers) {
573 SimulateMouseEvent(WebInputEvent::MouseMove, x, y, modifiers, false); 573 SimulateMouseEvent(WebInputEvent::MouseMove, x, y, modifiers, false);
574 } 574 }
575 575
576 void SimulateMouseEvent( 576 void SimulateMouseEvent(
577 WebInputEvent::Type type, int x, int y, int modifiers, bool pressed) { 577 WebInputEvent::Type type, int x, int y, int modifiers, bool pressed) {
578 WebMouseEvent event = 578 WebMouseEvent event =
579 SyntheticWebMouseEventBuilder::Build(type, x, y, modifiers); 579 SyntheticWebMouseEventBuilder::Build(type, x, y, modifiers);
580 if (pressed) 580 if (pressed)
581 event.button = WebMouseEvent::ButtonLeft; 581 event.button = WebMouseEvent::Button::Left;
582 event.timeStampSeconds = GetNextSimulatedEventTimeSeconds(); 582 event.timeStampSeconds = GetNextSimulatedEventTimeSeconds();
583 host_->ForwardMouseEvent(event); 583 host_->ForwardMouseEvent(event);
584 } 584 }
585 585
586 // Inject simple synthetic WebGestureEvent instances. 586 // Inject simple synthetic WebGestureEvent instances.
587 void SimulateGestureEvent(WebInputEvent::Type type, 587 void SimulateGestureEvent(WebInputEvent::Type type,
588 WebGestureDevice sourceDevice) { 588 WebGestureDevice sourceDevice) {
589 host_->ForwardGestureEvent( 589 host_->ForwardGestureEvent(
590 SyntheticWebGestureEventBuilder::Build(type, sourceDevice)); 590 SyntheticWebGestureEventBuilder::Build(type, sourceDevice));
591 } 591 }
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 ui::LatencyInfo()); 1696 ui::LatencyInfo());
1697 1697
1698 1698
1699 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). 1699 // Tests RWHI::ForwardWheelEventWithLatencyInfo().
1700 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); 1700 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo());
1701 1701
1702 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); 1702 ASSERT_FALSE(host_->input_router()->HasPendingEvents());
1703 } 1703 }
1704 1704
1705 } // namespace content 1705 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698