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

Side by Side Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.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 // 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 "core/frame/VisualViewport.h" 5 #include "core/frame/VisualViewport.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 1467
1468 EXPECT_POINT_EQ(FloatPoint(300, 200), visualViewport.location()); 1468 EXPECT_POINT_EQ(FloatPoint(300, 200), visualViewport.location());
1469 1469
1470 // Send a scroll event on the main thread path. 1470 // Send a scroll event on the main thread path.
1471 PlatformGestureEvent gsu( 1471 PlatformGestureEvent gsu(
1472 PlatformEvent::GestureScrollUpdate, 1472 PlatformEvent::GestureScrollUpdate,
1473 IntPoint(0, 0), 1473 IntPoint(0, 0),
1474 IntPoint(0, 0), 1474 IntPoint(0, 0),
1475 IntSize(5, 5), 1475 IntSize(5, 5),
1476 0, PlatformEvent::NoModifiers, PlatformGestureSourceTouchpad); 1476 0, PlatformEvent::NoModifiers, PlatformGestureSourceTouchpad);
1477 gsu.setScrollGestureData(-50, -60, 1, 1, false, false, -1 /* null plugin id */); 1477 gsu.setScrollGestureData(-50, -60, ScrollByPrecisePixel, 1, 1, false, false, -1 /* null plugin id */);
1478 1478
1479 frame()->eventHandler().handleGestureEvent(gsu); 1479 frame()->eventHandler().handleGestureEvent(gsu);
1480 1480
1481 // The scroll sent from the impl-side must not be overwritten. 1481 // The scroll sent from the impl-side must not be overwritten.
1482 EXPECT_POINT_EQ(FloatPoint(350, 260), visualViewport.location()); 1482 EXPECT_POINT_EQ(FloatPoint(350, 260), visualViewport.location());
1483 } 1483 }
1484 1484
1485 static void accessibilitySettings(WebSettings* settings) 1485 static void accessibilitySettings(WebSettings* settings)
1486 { 1486 {
1487 VisualViewportTest::configureSettings(settings); 1487 VisualViewportTest::configureSettings(settings);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 webViewImpl()->handleInputEvent(pinchUpdate); 1610 webViewImpl()->handleInputEvent(pinchUpdate);
1611 1611
1612 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi ewport(); 1612 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi ewport();
1613 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); 1613 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView();
1614 1614
1615 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); 1615 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location());
1616 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); 1616 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble());
1617 } 1617 }
1618 1618
1619 } // namespace 1619 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698