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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Rebase Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 089729b50e6e7f3a2dc6d7868477b3c9b1320942..59663d5eb2075868d5ba635eec2c04b242c77cbc 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -5881,8 +5881,8 @@ class DisambiguationPopupTestWebViewClient
};
static WebGestureEvent fatTap(int x, int y) {
- WebGestureEvent event;
- event.type = WebInputEvent::GestureTap;
+ WebGestureEvent event(WebInputEvent::GestureTap, WebInputEvent::NoModifiers,
+ WebInputEvent::TimeStampForTesting);
event.sourceDevice = WebGestureDeviceTouchscreen;
event.x = x;
event.y = y;
@@ -9730,8 +9730,8 @@ class WebFrameOverscrollTest
WebGestureEvent generateEvent(WebInputEvent::Type type,
float deltaX = 0.0,
float deltaY = 0.0) {
- WebGestureEvent event;
- event.type = type;
+ WebGestureEvent event(type, WebInputEvent::NoModifiers,
+ WebInputEvent::TimeStampForTesting);
// TODO(wjmaclean): Make sure that touchpad device is only ever used for
// gesture scrolling event types.
event.sourceDevice = GetParam();
@@ -10670,14 +10670,17 @@ TEST_F(WebFrameTest, ScrollBeforeLayoutDoesntCrash) {
Document* document = webView->mainFrameImpl()->frame()->document();
document->documentElement()->setLayoutObject(nullptr);
- WebGestureEvent beginEvent;
- beginEvent.type = WebInputEvent::GestureScrollEnd;
+ WebGestureEvent beginEvent(WebInputEvent::GestureScrollBegin,
+ WebInputEvent::NoModifiers,
+ WebInputEvent::TimeStampForTesting);
beginEvent.sourceDevice = WebGestureDeviceTouchpad;
- WebGestureEvent updateEvent;
- updateEvent.type = WebInputEvent::GestureScrollEnd;
+ WebGestureEvent updateEvent(WebInputEvent::GestureScrollUpdate,
+ WebInputEvent::NoModifiers,
+ WebInputEvent::TimeStampForTesting);
updateEvent.sourceDevice = WebGestureDeviceTouchpad;
- WebGestureEvent endEvent;
- endEvent.type = WebInputEvent::GestureScrollEnd;
+ WebGestureEvent endEvent(WebInputEvent::GestureScrollEnd,
+ WebInputEvent::NoModifiers,
+ WebInputEvent::TimeStampForTesting);
endEvent.sourceDevice = WebGestureDeviceTouchpad;
// Try GestureScrollEnd and GestureScrollUpdate first to make sure that not

Powered by Google App Engine
This is Rietveld 408576698