OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Make sure the scrolling coordinator is active. | 121 // Make sure the scrolling coordinator is active. |
122 FrameView* frameView = frame()->view(); | 122 FrameView* frameView = frame()->view(); |
123 Page* page = frame()->page(); | 123 Page* page = frame()->page(); |
124 ASSERT_TRUE(page->scrollingCoordinator()); | 124 ASSERT_TRUE(page->scrollingCoordinator()); |
125 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f
rameView)); | 125 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f
rameView)); |
126 | 126 |
127 // Fast scrolling should be enabled by default. | 127 // Fast scrolling should be enabled by default. |
128 WebLayer* rootScrollLayer = getRootScrollLayer(); | 128 WebLayer* rootScrollLayer = getRootScrollLayer(); |
129 ASSERT_TRUE(rootScrollLayer->scrollable()); | 129 ASSERT_TRUE(rootScrollLayer->scrollable()); |
130 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); | 130 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); |
131 ASSERT_EQ(WebEventListenerProperties::Nothing, webLayerTreeView()->eventList
enerProperties(WebEventListenerClass::Touch)); | 131 ASSERT_EQ(WebEventListenerProperties::Nothing, webLayerTreeView()->eventList
enerProperties(WebEventListenerClass::TouchStartOrMove)); |
132 ASSERT_EQ(WebEventListenerProperties::Nothing, webLayerTreeView()->eventList
enerProperties(WebEventListenerClass::MouseWheel)); | 132 ASSERT_EQ(WebEventListenerProperties::Nothing, webLayerTreeView()->eventList
enerProperties(WebEventListenerClass::MouseWheel)); |
133 } | 133 } |
134 | 134 |
135 TEST_F(ScrollingCoordinatorTest, fastScrollingCanBeDisabledWithSetting) | 135 TEST_F(ScrollingCoordinatorTest, fastScrollingCanBeDisabledWithSetting) |
136 { | 136 { |
137 navigateTo("about:blank"); | 137 navigateTo("about:blank"); |
138 webViewImpl()->settings()->setThreadedScrollingEnabled(false); | 138 webViewImpl()->settings()->setThreadedScrollingEnabled(false); |
139 forceFullCompositingUpdate(); | 139 forceFullCompositingUpdate(); |
140 | 140 |
141 // Make sure the scrolling coordinator is active. | 141 // Make sure the scrolling coordinator is active. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 ASSERT_TRUE(constraint.isFixedToRightEdge && constraint.isFixedToBottomE
dge); | 287 ASSERT_TRUE(constraint.isFixedToRightEdge && constraint.isFixedToBottomE
dge); |
288 } | 288 } |
289 } | 289 } |
290 | 290 |
291 TEST_F(ScrollingCoordinatorTest, touchEventHandler) | 291 TEST_F(ScrollingCoordinatorTest, touchEventHandler) |
292 { | 292 { |
293 registerMockedHttpURLLoad("touch-event-handler.html"); | 293 registerMockedHttpURLLoad("touch-event-handler.html"); |
294 navigateTo(m_baseURL + "touch-event-handler.html"); | 294 navigateTo(m_baseURL + "touch-event-handler.html"); |
295 forceFullCompositingUpdate(); | 295 forceFullCompositingUpdate(); |
296 | 296 |
297 ASSERT_EQ(WebEventListenerProperties::Blocking, webLayerTreeView()->eventLis
tenerProperties(WebEventListenerClass::Touch)); | 297 ASSERT_EQ(WebEventListenerProperties::Blocking, webLayerTreeView()->eventLis
tenerProperties(WebEventListenerClass::TouchStartOrMove)); |
298 } | 298 } |
299 | 299 |
300 TEST_F(ScrollingCoordinatorTest, touchEventHandlerPassive) | 300 TEST_F(ScrollingCoordinatorTest, touchEventHandlerPassive) |
301 { | 301 { |
302 registerMockedHttpURLLoad("touch-event-handler-passive.html"); | 302 registerMockedHttpURLLoad("touch-event-handler-passive.html"); |
303 navigateTo(m_baseURL + "touch-event-handler-passive.html"); | 303 navigateTo(m_baseURL + "touch-event-handler-passive.html"); |
304 forceFullCompositingUpdate(); | 304 forceFullCompositingUpdate(); |
305 | 305 |
306 ASSERT_EQ(WebEventListenerProperties::Passive, webLayerTreeView()->eventList
enerProperties(WebEventListenerClass::Touch)); | 306 ASSERT_EQ(WebEventListenerProperties::Passive, webLayerTreeView()->eventList
enerProperties(WebEventListenerClass::TouchStartOrMove)); |
307 } | 307 } |
308 | 308 |
309 TEST_F(ScrollingCoordinatorTest, touchEventHandlerBoth) | 309 TEST_F(ScrollingCoordinatorTest, touchEventHandlerBoth) |
310 { | 310 { |
311 registerMockedHttpURLLoad("touch-event-handler-both.html"); | 311 registerMockedHttpURLLoad("touch-event-handler-both.html"); |
312 navigateTo(m_baseURL + "touch-event-handler-both.html"); | 312 navigateTo(m_baseURL + "touch-event-handler-both.html"); |
313 forceFullCompositingUpdate(); | 313 forceFullCompositingUpdate(); |
314 | 314 |
315 ASSERT_EQ(WebEventListenerProperties::BlockingAndPassive, webLayerTreeView()
->eventListenerProperties(WebEventListenerClass::Touch)); | 315 ASSERT_EQ(WebEventListenerProperties::BlockingAndPassive, webLayerTreeView()
->eventListenerProperties(WebEventListenerClass::TouchStartOrMove)); |
316 } | 316 } |
317 | 317 |
318 TEST_F(ScrollingCoordinatorTest, wheelEventHandler) | 318 TEST_F(ScrollingCoordinatorTest, wheelEventHandler) |
319 { | 319 { |
320 registerMockedHttpURLLoad("wheel-event-handler.html"); | 320 registerMockedHttpURLLoad("wheel-event-handler.html"); |
321 navigateTo(m_baseURL + "wheel-event-handler.html"); | 321 navigateTo(m_baseURL + "wheel-event-handler.html"); |
322 forceFullCompositingUpdate(); | 322 forceFullCompositingUpdate(); |
323 | 323 |
324 ASSERT_EQ(WebEventListenerProperties::Blocking, webLayerTreeView()->eventLis
tenerProperties(WebEventListenerClass::MouseWheel)); | 324 ASSERT_EQ(WebEventListenerProperties::Blocking, webLayerTreeView()->eventLis
tenerProperties(WebEventListenerClass::MouseWheel)); |
325 } | 325 } |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 EXPECT_FALSE(scrollLayer->shouldScrollOnMainThread()); | 624 EXPECT_FALSE(scrollLayer->shouldScrollOnMainThread()); |
625 | 625 |
626 fixedPos->setInlineStyleProperty(CSSPropertyTransform, CSSValueNone); | 626 fixedPos->setInlineStyleProperty(CSSPropertyTransform, CSSValueNone); |
627 forceFullCompositingUpdate(); | 627 forceFullCompositingUpdate(); |
628 | 628 |
629 EXPECT_FALSE(static_cast<LayoutBoxModelObject*>(fixedPos->layoutObject())->l
ayer()->hasCompositedLayerMapping()); | 629 EXPECT_FALSE(static_cast<LayoutBoxModelObject*>(fixedPos->layoutObject())->l
ayer()->hasCompositedLayerMapping()); |
630 EXPECT_TRUE(scrollLayer->shouldScrollOnMainThread()); | 630 EXPECT_TRUE(scrollLayer->shouldScrollOnMainThread()); |
631 } | 631 } |
632 | 632 |
633 } // namespace blink | 633 } // namespace blink |
OLD | NEW |