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

Side by Side Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 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/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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 VisualViewport& visualViewport = 1858 VisualViewport& visualViewport =
1859 frame()->page()->frameHost().visualViewport(); 1859 frame()->page()->frameHost().visualViewport();
1860 1860
1861 // Apply some scroll and scale from the impl-side. 1861 // Apply some scroll and scale from the impl-side.
1862 webViewImpl()->applyViewportDeltas(WebFloatSize(300, 200), WebFloatSize(0, 0), 1862 webViewImpl()->applyViewportDeltas(WebFloatSize(300, 200), WebFloatSize(0, 0),
1863 WebFloatSize(0, 0), 2, 0); 1863 WebFloatSize(0, 0), 2, 0);
1864 1864
1865 EXPECT_SIZE_EQ(FloatSize(300, 200), visualViewport.getScrollOffset()); 1865 EXPECT_SIZE_EQ(FloatSize(300, 200), visualViewport.getScrollOffset());
1866 1866
1867 // Send a scroll event on the main thread path. 1867 // Send a scroll event on the main thread path.
1868 WebGestureEvent gsu; 1868 WebGestureEvent gsu(WebInputEvent::GestureScrollUpdate,
1869 WebInputEvent::NoModifiers,
1870 WebInputEvent::TimeStampForTesting);
1869 gsu.setFrameScale(1); 1871 gsu.setFrameScale(1);
1870 gsu.type = WebInputEvent::GestureScrollUpdate;
1871 gsu.sourceDevice = WebGestureDeviceTouchpad; 1872 gsu.sourceDevice = WebGestureDeviceTouchpad;
1872 gsu.data.scrollUpdate.deltaX = -50; 1873 gsu.data.scrollUpdate.deltaX = -50;
1873 gsu.data.scrollUpdate.deltaY = -60; 1874 gsu.data.scrollUpdate.deltaY = -60;
1874 gsu.data.scrollUpdate.deltaUnits = WebGestureEvent::PrecisePixels; 1875 gsu.data.scrollUpdate.deltaUnits = WebGestureEvent::PrecisePixels;
1875 gsu.data.scrollUpdate.velocityX = 1; 1876 gsu.data.scrollUpdate.velocityX = 1;
1876 gsu.data.scrollUpdate.velocityY = 1; 1877 gsu.data.scrollUpdate.velocityY = 1;
1877 1878
1878 frame()->eventHandler().handleGestureEvent(gsu); 1879 frame()->eventHandler().handleGestureEvent(gsu);
1879 1880
1880 // The scroll sent from the impl-side must not be overwritten. 1881 // The scroll sent from the impl-side must not be overwritten.
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
2470 " body {" 2471 " body {"
2471 " margin: 0px;" 2472 " margin: 0px;"
2472 " }" 2473 " }"
2473 " div { height:110vh; width: 110vw; }" 2474 " div { height:110vh; width: 110vw; }"
2474 "</style>" 2475 "</style>"
2475 "<div></div>", 2476 "<div></div>",
2476 baseURL); 2477 baseURL);
2477 } 2478 }
2478 2479
2479 } // namespace 2480 } // namespace
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698