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/RootFrameViewport.h" | 7 #include "core/frame/RootFrameViewport.h" |
8 | 8 |
9 #include "core/layout/ScrollAlignment.h" | 9 #include "core/layout/ScrollAlignment.h" |
10 #include "platform/geometry/DoubleRect.h" | 10 #include "platform/geometry/DoubleRect.h" |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 PlatformWheelEvent wheelEvent( | 487 PlatformWheelEvent wheelEvent( |
488 IntPoint(10, 10), IntPoint(10, 10), | 488 IntPoint(10, 10), IntPoint(10, 10), |
489 -500, -500, | 489 -500, -500, |
490 0, 0, | 490 0, 0, |
491 ScrollByPixelWheelEvent, | 491 ScrollByPixelWheelEvent, |
492 false, false, false, false); | 492 false, false, false, false); |
493 | 493 |
494 ScrollResult result = rootFrameViewport->handleWheel(wheelEvent); | 494 ScrollResult result = rootFrameViewport->handleWheel(wheelEvent); |
495 | 495 |
496 EXPECT_TRUE(result.didScroll); | 496 EXPECT_TRUE(result.didScroll()); |
497 EXPECT_POINT_EQ(DoublePoint(50, 50), visualViewport.scrollPositionDouble()); | 497 EXPECT_POINT_EQ(DoublePoint(50, 50), visualViewport.scrollPositionDouble()); |
498 EXPECT_POINT_EQ(DoublePoint(100, 200), layoutViewport.scrollPositionDouble()
); | 498 EXPECT_POINT_EQ(DoublePoint(100, 200), layoutViewport.scrollPositionDouble()
); |
499 EXPECT_EQ(-350, result.unusedScrollDeltaX); | 499 EXPECT_EQ(-350, result.unusedScrollDeltaX); |
500 EXPECT_EQ(-250, result.unusedScrollDeltaY); | 500 EXPECT_EQ(-250, result.unusedScrollDeltaY); |
501 } | 501 } |
502 | 502 |
503 } // namespace blink | 503 } // namespace blink |
OLD | NEW |