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

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

Issue 1403893003: Plumb gesture source value through Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing sourceDevice initialization in EventSender. Created 5 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 6
7 #include "core/frame/VisualViewport.h" 7 #include "core/frame/VisualViewport.h"
8 8
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 0); 1605 0);
1606 1606
1607 EXPECT_POINT_EQ(FloatPoint(300, 200), visualViewport.location()); 1607 EXPECT_POINT_EQ(FloatPoint(300, 200), visualViewport.location());
1608 1608
1609 // Send a scroll event on the main thread path. 1609 // Send a scroll event on the main thread path.
1610 PlatformGestureEvent gsu( 1610 PlatformGestureEvent gsu(
1611 PlatformEvent::GestureScrollUpdate, 1611 PlatformEvent::GestureScrollUpdate,
1612 IntPoint(0, 0), 1612 IntPoint(0, 0),
1613 IntPoint(0, 0), 1613 IntPoint(0, 0),
1614 IntSize(5, 5), 1614 IntSize(5, 5),
1615 0, PlatformEvent::NoModifiers); 1615 0, PlatformEvent::NoModifiers, PlatformGestureSourceUninitialized);
tdresser 2015/10/14 15:14:20 I'd like us to be able to assert throughout the co
wjmaclean 2015/10/14 15:55:09 Done.
1616 gsu.setScrollGestureData(-50, -60, 1, 1, false, false, -1 /* null plugin id */); 1616 gsu.setScrollGestureData(-50, -60, 1, 1, false, false, -1 /* null plugin id */);
1617 1617
1618 frame()->eventHandler().handleGestureEvent(gsu); 1618 frame()->eventHandler().handleGestureEvent(gsu);
1619 1619
1620 // The scroll sent from the impl-side must not be overwritten. 1620 // The scroll sent from the impl-side must not be overwritten.
1621 EXPECT_POINT_EQ(FloatPoint(350, 260), visualViewport.location()); 1621 EXPECT_POINT_EQ(FloatPoint(350, 260), visualViewport.location());
1622 } 1622 }
1623 1623
1624 static void accessibilitySettings(WebSettings* settings) 1624 static void accessibilitySettings(WebSettings* settings)
1625 { 1625 {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 TEST_P(ParameterizedVisualViewportTest, PinchZoomGestureScrollsVisualViewportOnl y) 1731 TEST_P(ParameterizedVisualViewportTest, PinchZoomGestureScrollsVisualViewportOnl y)
1732 { 1732 {
1733 initializeWithDesktopSettings(turnOnInvertedScrollOrder); 1733 initializeWithDesktopSettings(turnOnInvertedScrollOrder);
1734 webViewImpl()->resize(IntSize(100, 100)); 1734 webViewImpl()->resize(IntSize(100, 100));
1735 1735
1736 registerMockedHttpURLLoad("200-by-800-viewport.html"); 1736 registerMockedHttpURLLoad("200-by-800-viewport.html");
1737 navigateTo(m_baseURL + "200-by-800-viewport.html"); 1737 navigateTo(m_baseURL + "200-by-800-viewport.html");
1738 1738
1739 WebGestureEvent pinchUpdate; 1739 WebGestureEvent pinchUpdate;
1740 pinchUpdate.type = WebInputEvent::GesturePinchUpdate; 1740 pinchUpdate.type = WebInputEvent::GesturePinchUpdate;
1741 pinchUpdate.sourceDevice = WebGestureDeviceTouchpad;
1741 pinchUpdate.x = 100; 1742 pinchUpdate.x = 100;
1742 pinchUpdate.y = 100; 1743 pinchUpdate.y = 100;
1743 pinchUpdate.data.pinchUpdate.scale = 2; 1744 pinchUpdate.data.pinchUpdate.scale = 2;
1744 pinchUpdate.data.pinchUpdate.zoomDisabled = false; 1745 pinchUpdate.data.pinchUpdate.zoomDisabled = false;
1745 1746
1746 webViewImpl()->handleInputEvent(pinchUpdate); 1747 webViewImpl()->handleInputEvent(pinchUpdate);
1747 1748
1748 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi ewport(); 1749 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi ewport();
1749 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); 1750 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView();
1750 1751
1751 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); 1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location());
1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); 1753 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble());
1753 } 1754 }
1754 1755
1755 } // namespace 1756 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698