| 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 "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/BrowserControls.h" | 8 #include "core/frame/BrowserControls.h" |
| 9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1853 frame()->page()->frameHost().visualViewport(); | 1853 frame()->page()->frameHost().visualViewport(); |
| 1854 | 1854 |
| 1855 // Apply some scroll and scale from the impl-side. | 1855 // Apply some scroll and scale from the impl-side. |
| 1856 webViewImpl()->applyViewportDeltas(WebFloatSize(300, 200), WebFloatSize(0, 0), | 1856 webViewImpl()->applyViewportDeltas(WebFloatSize(300, 200), WebFloatSize(0, 0), |
| 1857 WebFloatSize(0, 0), 2, 0); | 1857 WebFloatSize(0, 0), 2, 0); |
| 1858 | 1858 |
| 1859 EXPECT_SIZE_EQ(FloatSize(300, 200), visualViewport.scrollOffset()); | 1859 EXPECT_SIZE_EQ(FloatSize(300, 200), visualViewport.scrollOffset()); |
| 1860 | 1860 |
| 1861 // Send a scroll event on the main thread path. | 1861 // Send a scroll event on the main thread path. |
| 1862 PlatformGestureEvent gsu(PlatformEvent::GestureScrollUpdate, IntPoint(0, 0), | 1862 PlatformGestureEvent gsu(PlatformEvent::GestureScrollUpdate, IntPoint(0, 0), |
| 1863 IntPoint(0, 0), IntSize(5, 5), 0, | 1863 IntPoint(0, 0), IntSize(5, 5), TimeTicks(), |
| 1864 PlatformEvent::NoModifiers, | 1864 PlatformEvent::NoModifiers, |
| 1865 PlatformGestureSourceTouchpad); | 1865 PlatformGestureSourceTouchpad); |
| 1866 gsu.setScrollGestureData(-50, -60, ScrollByPrecisePixel, 1, 1, | 1866 gsu.setScrollGestureData(-50, -60, ScrollByPrecisePixel, 1, 1, |
| 1867 ScrollInertialPhaseUnknown, false, | 1867 ScrollInertialPhaseUnknown, false, |
| 1868 -1 /* null plugin id */); | 1868 -1 /* null plugin id */); |
| 1869 | 1869 |
| 1870 frame()->eventHandler().handleGestureEvent(gsu); | 1870 frame()->eventHandler().handleGestureEvent(gsu); |
| 1871 | 1871 |
| 1872 // The scroll sent from the impl-side must not be overwritten. | 1872 // The scroll sent from the impl-side must not be overwritten. |
| 1873 EXPECT_SIZE_EQ(FloatSize(350, 260), visualViewport.scrollOffset()); | 1873 EXPECT_SIZE_EQ(FloatSize(350, 260), visualViewport.scrollOffset()); |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2386 if (rootLayerScrolling) | 2386 if (rootLayerScrolling) |
| 2387 EXPECT_TRUE(invalidationTracking); | 2387 EXPECT_TRUE(invalidationTracking); |
| 2388 else | 2388 else |
| 2389 EXPECT_FALSE(invalidationTracking); | 2389 EXPECT_FALSE(invalidationTracking); |
| 2390 | 2390 |
| 2391 document->view()->setTracksPaintInvalidations(false); | 2391 document->view()->setTracksPaintInvalidations(false); |
| 2392 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); | 2392 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); |
| 2393 } | 2393 } |
| 2394 | 2394 |
| 2395 } // namespace | 2395 } // namespace |
| OLD | NEW |