OLD | NEW |
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 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, false, false, false, false); | 1615 0, false, false, false, false); |
1616 gsu.setScrollGestureData(-50, -60, 1, 1, false, false); | 1616 gsu.setScrollGestureData(-50, -60, 1, 1, false, 0, false); |
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 { |
1626 VisualViewportTest::configureSettings(settings); | 1626 VisualViewportTest::configureSettings(settings); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 webViewImpl()->handleInputEvent(pinchUpdate); | 1746 webViewImpl()->handleInputEvent(pinchUpdate); |
1747 | 1747 |
1748 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); | 1748 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); |
1749 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1749 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
1750 | 1750 |
1751 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); | 1751 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); |
1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
1753 } | 1753 } |
1754 | 1754 |
1755 } // namespace | 1755 } // namespace |
OLD | NEW |