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) |