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

Unified Diff: third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync changes from patches 2111203004 + 2118773002. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
index 0f3f2a59e8ba0257ae59ae0799fc76546389ea3a..4b94c630373bf8229dd3cff29df5dbaebbb48674 100644
--- a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
+++ b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
@@ -26,7 +26,9 @@
#include "core/css/CSSStyleSheet.h"
#include "core/css/StyleSheetList.h"
+#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
+#include "core/frame/VisualViewport.h"
#include "core/layout/LayoutPart.h"
#include "core/layout/api/LayoutViewItem.h"
#include "core/layout/compositing/CompositedLayerMapping.h"
@@ -132,6 +134,10 @@ TEST_F(ScrollingCoordinatorTest, fastScrollingByDefault)
ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread());
ASSERT_EQ(WebEventListenerProperties::Nothing, webLayerTreeView()->eventListenerProperties(WebEventListenerClass::TouchStartOrMove));
ASSERT_EQ(WebEventListenerProperties::Nothing, webLayerTreeView()->eventListenerProperties(WebEventListenerClass::MouseWheel));
+
+ WebLayer* innerViewportScrollLayer = page->frameHost().visualViewport().scrollLayer()->platformLayer();
+ ASSERT_TRUE(innerViewportScrollLayer->scrollable());
+ ASSERT_FALSE(innerViewportScrollLayer->shouldScrollOnMainThread());
}
TEST_F(ScrollingCoordinatorTest, fastScrollingCanBeDisabledWithSetting)
@@ -150,6 +156,11 @@ TEST_F(ScrollingCoordinatorTest, fastScrollingCanBeDisabledWithSetting)
WebLayer* rootScrollLayer = getRootScrollLayer();
ASSERT_TRUE(rootScrollLayer->scrollable());
ASSERT_TRUE(rootScrollLayer->shouldScrollOnMainThread());
+
+ // Main scrolling should also propagate to inner viewport layer.
+ WebLayer* innerViewportScrollLayer = page->frameHost().visualViewport().scrollLayer()->platformLayer();
+ ASSERT_TRUE(innerViewportScrollLayer->scrollable());
+ ASSERT_TRUE(innerViewportScrollLayer->shouldScrollOnMainThread());
}

Powered by Google App Engine
This is Rietveld 408576698