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

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: almost there 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
Index: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
diff --git a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
index dc845c34bc0a75428588bc11b1a65e251d8ab6bc..316e5bd811d012a8522b31074e0c39176693ae81 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()));
@@ -166,6 +172,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();
@@ -280,6 +287,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.
« Source/core/rendering/RenderLayerCompositor.cpp ('K') | « Source/web/PageWidgetDelegate.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698