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

Unified Diff: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp

Issue 26110004: Defer the real work in updateCompositingLayers until it's really needed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing Created 7 years, 2 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
« no previous file with comments | « Source/web/PageWidgetDelegate.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
diff --git a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
index 9c6e80cd5f14398e223bd983fff891c3d980b8d7..d9713560bb41843347d3f335b10ca7babe1a0547 100644
--- a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
+++ b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
@@ -103,6 +103,12 @@ public:
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 @@ protected:
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 @@ TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingForFixedPosition)
{
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 @@ TEST_F(ScrollingCoordinatorChromiumTest, nonFastScrollableRegion)
{
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 @@ TEST_F(ScrollingCoordinatorChromiumTest, wheelEventHandler)
{
registerMockedHttpURLLoad("wheel-event-handler.html");
navigateTo(m_baseURL + "wheel-event-handler.html");
+ forceFullCompositingUpdate();
WebLayer* rootScrollLayer = getRootScrollLayer();
ASSERT_TRUE(rootScrollLayer->haveWheelEventHandlers());
@@ -271,6 +281,7 @@ TEST_F(ScrollingCoordinatorChromiumTest, clippedBodyTest)
{
registerMockedHttpURLLoad("clipped-body.html");
navigateTo(m_baseURL + "clipped-body.html");
+ forceFullCompositingUpdate();
WebLayer* rootScrollLayer = getRootScrollLayer();
ASSERT_EQ(0u, rootScrollLayer->nonFastScrollableRegion().size());
@@ -280,6 +291,7 @@ TEST_F(ScrollingCoordinatorChromiumTest, overflowScrolling)
{
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 @@ TEST_F(ScrollingCoordinatorChromiumTest, iframeScrolling)
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 @@ TEST_F(ScrollingCoordinatorChromiumTest, rtlIframe)
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 @@ TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash)
{
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.
}
« no previous file with comments | « Source/web/PageWidgetDelegate.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698