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

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

Issue 1577263004: Communicate whether passive event listeners exist to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners
Patch Set: Fix Android/ChromeOS build problems with bit packed enum class Created 4 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 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 2e2c00d48ad697b27b0d0e73ec3d7e7430a3cde7..0ca2c9169d098c94d0c50e33278aa2df4c1af0e5 100644
--- a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
+++ b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
@@ -124,7 +124,8 @@ TEST_F(ScrollingCoordinatorTest, fastScrollingByDefault)
WebLayer* rootScrollLayer = getRootScrollLayer();
ASSERT_TRUE(rootScrollLayer->scrollable());
ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread());
- ASSERT_FALSE(rootScrollLayer->haveWheelEventHandlers());
+ ASSERT_EQ(WebEventListenerProperties::Nothing, rootScrollLayer->touchEventListenerProperties());
+ ASSERT_EQ(WebEventListenerProperties::Nothing, rootScrollLayer->wheelEventListenerProperties());
}
TEST_F(ScrollingCoordinatorTest, fastScrollingCanBeDisabledWithSetting)
@@ -304,6 +305,36 @@ TEST_F(ScrollingCoordinatorTest, fastScrollingForFixedPosition)
}
}
+TEST_F(ScrollingCoordinatorTest, touchEventHandler)
+{
+ registerMockedHttpURLLoad("touch-event-handler.html");
+ navigateTo(m_baseURL + "touch-event-handler.html");
+ forceFullCompositingUpdate();
+
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ ASSERT_EQ(WebEventListenerProperties::Blocking, rootScrollLayer->touchEventListenerProperties());
+}
+
+TEST_F(ScrollingCoordinatorTest, touchEventHandlerPassive)
+{
+ registerMockedHttpURLLoad("touch-event-handler-passive.html");
+ navigateTo(m_baseURL + "touch-event-handler-passive.html");
+ forceFullCompositingUpdate();
+
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ ASSERT_EQ(WebEventListenerProperties::Passive, rootScrollLayer->touchEventListenerProperties());
+}
+
+TEST_F(ScrollingCoordinatorTest, touchEventHandlerBoth)
+{
+ registerMockedHttpURLLoad("touch-event-handler-both.html");
+ navigateTo(m_baseURL + "touch-event-handler-both.html");
+ forceFullCompositingUpdate();
+
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ ASSERT_EQ(WebEventListenerProperties::Passive | WebEventListenerProperties::Blocking, rootScrollLayer->touchEventListenerProperties());
+}
+
TEST_F(ScrollingCoordinatorTest, wheelEventHandler)
{
registerMockedHttpURLLoad("wheel-event-handler.html");
@@ -311,7 +342,27 @@ TEST_F(ScrollingCoordinatorTest, wheelEventHandler)
forceFullCompositingUpdate();
WebLayer* rootScrollLayer = getRootScrollLayer();
- ASSERT_TRUE(rootScrollLayer->haveWheelEventHandlers());
+ ASSERT_EQ(WebEventListenerProperties::Blocking, rootScrollLayer->wheelEventListenerProperties());
+}
+
+TEST_F(ScrollingCoordinatorTest, wheelEventHandlerPassive)
+{
+ registerMockedHttpURLLoad("wheel-event-handler-passive.html");
+ navigateTo(m_baseURL + "wheel-event-handler-passive.html");
+ forceFullCompositingUpdate();
+
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ ASSERT_EQ(WebEventListenerProperties::Passive, rootScrollLayer->wheelEventListenerProperties());
+}
+
+TEST_F(ScrollingCoordinatorTest, wheelEventHandlerBoth)
+{
+ registerMockedHttpURLLoad("wheel-event-handler-both.html");
+ navigateTo(m_baseURL + "wheel-event-handler-both.html");
+ forceFullCompositingUpdate();
+
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ ASSERT_EQ(WebEventListenerProperties::Passive | WebEventListenerProperties::Blocking, rootScrollLayer->wheelEventListenerProperties());
}
TEST_F(ScrollingCoordinatorTest, scrollEventHandler)

Powered by Google App Engine
This is Rietveld 408576698