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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp

Issue 1557993002: Add scroll units in GestureEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 { 434 {
435 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10) , NoButton, PlatformEvent::MouseMoved, 1, PlatformEvent::NoModifiers, PlatformMo useEvent::RealOrIndistinguishable, 0); 435 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10) , NoButton, PlatformEvent::MouseMoved, 1, PlatformEvent::NoModifiers, PlatformMo useEvent::RealOrIndistinguishable, 0);
436 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventType Names::mousemove, domWindow, platformMouseEvent, 0, document); 436 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventType Names::mousemove, domWindow, platformMouseEvent, 0, document);
437 WebMouseEventBuilder webMouseBuilder(view, documentLayoutView, *mouseEve nt); 437 WebMouseEventBuilder webMouseBuilder(view, documentLayoutView, *mouseEve nt);
438 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); 438 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button);
439 } 439 }
440 440
441 { 441 {
442 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp date, IntPoint(10, 12), IntPoint(20, 22), IntSize(25, 27), 0, 442 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp date, IntPoint(10, 12), IntPoint(20, 22), IntSize(25, 27), 0,
443 PlatformEvent::NoModifiers, PlatformGestureSourceTouchscreen); 443 PlatformEvent::NoModifiers, PlatformGestureSourceTouchscreen);
444 platformGestureEvent.setScrollGestureData(30, 32, 40, 42, true, true, -1 /* null plugin id */); 444 platformGestureEvent.setScrollGestureData(30, 32, ScrollByPrecisePixel, 40, 42, true, true, -1 /* null plugin id */);
445 // FIXME: GestureEvent does not preserve velocityX, velocityY, 445 // FIXME: GestureEvent does not preserve velocityX, velocityY,
446 // or preventPropagation. It also fails to scale 446 // or preventPropagation. It also fails to scale
447 // coordinates (x, y, deltaX, deltaY) to the page scale. This 447 // coordinates (x, y, deltaX, deltaY) to the page scale. This
448 // may lead to unexpected bugs if a PlatformGestureEvent is 448 // may lead to unexpected bugs if a PlatformGestureEvent is
449 // transformed into WebGestureEvent and back. 449 // transformed into WebGestureEvent and back.
450 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom Window, platformGestureEvent); 450 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom Window, platformGestureEvent);
451 WebGestureEventBuilder webGestureBuilder(documentLayoutView, *gestureEve nt); 451 WebGestureEventBuilder webGestureBuilder(documentLayoutView, *gestureEve nt);
452 452
453 EXPECT_EQ(10, webGestureBuilder.x); 453 EXPECT_EQ(10, webGestureBuilder.x);
454 EXPECT_EQ(12, webGestureBuilder.y); 454 EXPECT_EQ(12, webGestureBuilder.y);
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 EXPECT_EQ(15, platformWheelBuilder.deltaX()); 986 EXPECT_EQ(15, platformWheelBuilder.deltaX());
987 EXPECT_EQ(10, platformWheelBuilder.deltaY()); 987 EXPECT_EQ(10, platformWheelBuilder.deltaY());
988 EXPECT_EQ(PlatformEvent::AltKey, platformWheelBuilder.modifiers()); 988 EXPECT_EQ(PlatformEvent::AltKey, platformWheelBuilder.modifiers());
989 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); 989 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas());
990 EXPECT_FALSE(platformWheelBuilder.canScroll()); 990 EXPECT_FALSE(platformWheelBuilder.canScroll());
991 EXPECT_EQ(platformWheelBuilder.railsMode(), PlatformEvent::RailsModeVert ical); 991 EXPECT_EQ(platformWheelBuilder.railsMode(), PlatformEvent::RailsModeVert ical);
992 } 992 }
993 } 993 }
994 994
995 } // namespace blink 995 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698