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

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

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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/VisualViewportTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
index 26d508ee564501d5b14eaf35506be95f50cdaea7..a42335a1d50f38ec69bffc15f0397e93b1295622 100644
--- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -23,6 +23,7 @@
#include "platform/graphics/CompositorElementId.h"
#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "platform/testing/URLTestHelpers.h"
+#include "public/platform/CoalescedWebInputEvent.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCachePolicy.h"
#include "public/platform/WebInputEvent.h"
@@ -1180,12 +1181,12 @@ TEST_P(VisualViewportTest, TestContextMenuShownInCorrectLocation) {
// Do a sanity check with no scale applied.
webViewImpl()->mainFrameImpl()->setClient(&mockWebFrameClient);
- webViewImpl()->handleInputEvent(mouseDownEvent);
- webViewImpl()->handleInputEvent(mouseUpEvent);
+ webViewImpl()->handleInputEvent(CoalescedWebInputEvent(mouseDownEvent));
+ webViewImpl()->handleInputEvent(CoalescedWebInputEvent(mouseUpEvent));
Mock::VerifyAndClearExpectations(&mockWebFrameClient);
mouseDownEvent.button = WebMouseEvent::Button::Left;
- webViewImpl()->handleInputEvent(mouseDownEvent);
+ webViewImpl()->handleInputEvent(CoalescedWebInputEvent(mouseDownEvent));
// Now pinch zoom into the page and move the visual viewport. The context menu
// should still appear at the location of the event, relative to the WebView.
@@ -1198,8 +1199,10 @@ TEST_P(VisualViewportTest, TestContextMenuShownInCorrectLocation) {
mouseDownEvent.x, mouseDownEvent.y)));
mouseDownEvent.button = WebMouseEvent::Button::Right;
- webViewImpl()->handleInputEvent(mouseDownEvent);
- webViewImpl()->handleInputEvent(mouseUpEvent);
+ webViewImpl()->handleInputEvent(mouseDownEvent,
+ std::vector<const WebInputEvent*>());
+ webViewImpl()->handleInputEvent(mouseUpEvent,
+ std::vector<const WebInputEvent*>());
// Reset the old client so destruction can occur naturally.
webViewImpl()->mainFrameImpl()->setClient(oldClient);
@@ -2019,7 +2022,8 @@ TEST_P(VisualViewportTest, PinchZoomGestureScrollsVisualViewportOnly) {
pinchUpdate.data.pinchUpdate.scale = 2;
pinchUpdate.data.pinchUpdate.zoomDisabled = false;
- webViewImpl()->handleInputEvent(pinchUpdate);
+ webViewImpl()->handleInputEvent(pinchUpdate,
+ std::vector<const WebInputEvent*>());
VisualViewport& visualViewport =
webViewImpl()->page()->frameHost().visualViewport();

Powered by Google App Engine
This is Rietveld 408576698