| Index: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
|
| ===================================================================
|
| --- Source/web/tests/ScrollingCoordinatorChromiumTest.cpp (revision 159992)
|
| +++ Source/web/tests/ScrollingCoordinatorChromiumTest.cpp (working copy)
|
| @@ -103,6 +103,12 @@
|
| Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
|
| }
|
|
|
| + void forceFullCompositingUpdate()
|
| + {
|
| + RenderLayerCompositor* compositor = m_webViewImpl->mainFrameImpl()->frame()->contentRenderer()->compositor();
|
| + compositor->updateCompositingLayers(CompositingUpdateFinishAllDeferredWork);
|
| + }
|
| +
|
| void registerMockedHttpURLLoad(const std::string& fileName)
|
| {
|
| URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8(fileName.c_str()));
|
| @@ -129,6 +135,7 @@
|
| TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefault)
|
| {
|
| navigateTo("about:blank");
|
| + forceFullCompositingUpdate();
|
|
|
| // Make sure the scrolling coordinator is active.
|
| FrameView* frameView = m_webViewImpl->mainFrameImpl()->frameView();
|
| @@ -166,6 +173,7 @@
|
| {
|
| registerMockedHttpURLLoad("fixed-position.html");
|
| navigateTo(m_baseURL + "fixed-position.html");
|
| + forceFullCompositingUpdate();
|
|
|
| // Fixed position should not fall back to main thread scrolling.
|
| WebLayer* rootScrollLayer = getRootScrollLayer();
|
| @@ -250,6 +258,7 @@
|
| {
|
| registerMockedHttpURLLoad("non-fast-scrollable.html");
|
| navigateTo(m_baseURL + "non-fast-scrollable.html");
|
| + forceFullCompositingUpdate();
|
|
|
| WebLayer* rootScrollLayer = getRootScrollLayer();
|
| WebVector<WebRect> nonFastScrollableRegion = rootScrollLayer->nonFastScrollableRegion();
|
| @@ -262,6 +271,7 @@
|
| {
|
| registerMockedHttpURLLoad("wheel-event-handler.html");
|
| navigateTo(m_baseURL + "wheel-event-handler.html");
|
| + forceFullCompositingUpdate();
|
|
|
| WebLayer* rootScrollLayer = getRootScrollLayer();
|
| ASSERT_TRUE(rootScrollLayer->haveWheelEventHandlers());
|
| @@ -271,6 +281,7 @@
|
| {
|
| registerMockedHttpURLLoad("clipped-body.html");
|
| navigateTo(m_baseURL + "clipped-body.html");
|
| + forceFullCompositingUpdate();
|
|
|
| WebLayer* rootScrollLayer = getRootScrollLayer();
|
| ASSERT_EQ(0u, rootScrollLayer->nonFastScrollableRegion().size());
|
| @@ -280,6 +291,7 @@
|
| {
|
| registerMockedHttpURLLoad("overflow-scrolling.html");
|
| navigateTo(m_baseURL + "overflow-scrolling.html");
|
| + forceFullCompositingUpdate();
|
|
|
| // Verify the properties of the accelerated scrolling element starting from the RenderObject
|
| // all the way to the WebLayer.
|
| @@ -318,6 +330,7 @@
|
| registerMockedHttpURLLoad("iframe-scrolling.html");
|
| registerMockedHttpURLLoad("iframe-scrolling-inner.html");
|
| navigateTo(m_baseURL + "iframe-scrolling.html");
|
| + forceFullCompositingUpdate();
|
|
|
| // Verify the properties of the accelerated scrolling element starting from the RenderObject
|
| // all the way to the WebLayer.
|
| @@ -361,6 +374,7 @@
|
| registerMockedHttpURLLoad("rtl-iframe.html");
|
| registerMockedHttpURLLoad("rtl-iframe-inner.html");
|
| navigateTo(m_baseURL + "rtl-iframe.html");
|
| + forceFullCompositingUpdate();
|
|
|
| // Verify the properties of the accelerated scrolling element starting from the RenderObject
|
| // all the way to the WebLayer.
|
| @@ -399,6 +413,7 @@
|
| {
|
| registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html");
|
| navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html");
|
| + forceFullCompositingUpdate();
|
| // This test document setup an iframe with scrollbars, then switch to
|
| // an empty document by javascript.
|
| }
|
|
|