Index: Source/web/tests/GraphicsLayerTest.cpp |
diff --git a/Source/web/tests/GraphicsLayerTest.cpp b/Source/web/tests/GraphicsLayerTest.cpp |
index 4b00655268b82910b869ed1e5e3c7cba976eb102..926676c9c7890fb0ae3f2b6742f86d58e738680d 100644 |
--- a/Source/web/tests/GraphicsLayerTest.cpp |
+++ b/Source/web/tests/GraphicsLayerTest.cpp |
@@ -65,11 +65,17 @@ class GraphicsLayerTest : public testing::Test { |
public: |
GraphicsLayerTest() |
{ |
+ m_clipLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); |
m_graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); |
+ m_clipLayer->addChild(m_graphicsLayer.get()); |
+ m_graphicsLayer->platformLayer()->setScrollClipLayer( |
+ m_clipLayer->platformLayer()); |
m_platformLayer = m_graphicsLayer->platformLayer(); |
m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest)); |
ASSERT(m_layerTreeView); |
- m_layerTreeView->setRootLayer(*m_platformLayer); |
+ m_layerTreeView->setRootLayer(*m_clipLayer->platformLayer()); |
+ m_layerTreeView->registerViewportLayers( |
+ m_clipLayer->platformLayer(), m_graphicsLayer->platformLayer(), 0); |
m_layerTreeView->setViewportSize(WebSize(1, 1), WebSize(1, 1)); |
} |
@@ -82,6 +88,7 @@ public: |
protected: |
WebLayer* m_platformLayer; |
OwnPtr<GraphicsLayerForTesting> m_graphicsLayer; |
+ OwnPtr<GraphicsLayerForTesting> m_clipLayer; |
private: |
OwnPtr<WebLayerTreeView> m_layerTreeView; |