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/PinchViewport.h" | 7 #include "core/frame/PinchViewport.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 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 | 1591 |
1592 EXPECT_POINT_EQ(FloatPoint(300, 200), pinchViewport.location()); | 1592 EXPECT_POINT_EQ(FloatPoint(300, 200), pinchViewport.location()); |
1593 | 1593 |
1594 // Send a scroll event on the main thread path. | 1594 // Send a scroll event on the main thread path. |
1595 PlatformGestureEvent gsu( | 1595 PlatformGestureEvent gsu( |
1596 PlatformEvent::GestureScrollUpdate, | 1596 PlatformEvent::GestureScrollUpdate, |
1597 IntPoint(0, 0), | 1597 IntPoint(0, 0), |
1598 IntPoint(0, 0), | 1598 IntPoint(0, 0), |
1599 IntSize(5, 5), | 1599 IntSize(5, 5), |
1600 0, false, false, false, false); | 1600 0, false, false, false, false); |
1601 gsu.setScrollGestureData(-50, -60, 1, 1, false, false); | 1601 gsu.setScrollGestureData(-50, -60, 1, 1, false, false, PlatformEvent::RailsM
odeFree); |
1602 | 1602 |
1603 frame()->eventHandler().handleGestureEvent(gsu); | 1603 frame()->eventHandler().handleGestureEvent(gsu); |
1604 | 1604 |
1605 // The scroll sent from the impl-side must not be overwritten. | 1605 // The scroll sent from the impl-side must not be overwritten. |
1606 EXPECT_POINT_EQ(FloatPoint(350, 260), pinchViewport.location()); | 1606 EXPECT_POINT_EQ(FloatPoint(350, 260), pinchViewport.location()); |
1607 } | 1607 } |
1608 | 1608 |
1609 static void accessibilitySettings(WebSettings* settings) | 1609 static void accessibilitySettings(WebSettings* settings) |
1610 { | 1610 { |
1611 PinchViewportTest::configureSettings(settings); | 1611 PinchViewportTest::configureSettings(settings); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 EXPECT_FLOAT_POINT_EQ(FloatPoint(81, 100.8), pinchViewport.rootFrameToViewpo
rt(FloatPoint(50.5, 62.4))); | 1666 EXPECT_FLOAT_POINT_EQ(FloatPoint(81, 100.8), pinchViewport.rootFrameToViewpo
rt(FloatPoint(50.5, 62.4))); |
1667 | 1667 |
1668 | 1668 |
1669 // Scrolling the main frame should have no effect. | 1669 // Scrolling the main frame should have no effect. |
1670 frameView.scrollTo(DoublePoint(100, 120)); | 1670 frameView.scrollTo(DoublePoint(100, 120)); |
1671 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 62), pinchViewport.viewportToRootFrame(
FloatPoint(80, 100))); | 1671 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 62), pinchViewport.viewportToRootFrame(
FloatPoint(80, 100))); |
1672 EXPECT_FLOAT_POINT_EQ(FloatPoint(80, 100), pinchViewport.rootFrameToViewport
(FloatPoint(50, 62))); | 1672 EXPECT_FLOAT_POINT_EQ(FloatPoint(80, 100), pinchViewport.rootFrameToViewport
(FloatPoint(50, 62))); |
1673 } | 1673 } |
1674 | 1674 |
1675 } // namespace | 1675 } // namespace |
OLD | NEW |