Index: Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp |
=================================================================== |
--- Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (revision 114754) |
+++ Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (working copy) |
@@ -1257,6 +1257,38 @@ |
runTestThreaded(); |
} |
+// This test verifies that properties on the layer tree host are commited to the impl side. |
+class CCLayerTreeHostTestCommit : public CCLayerTreeHostTest { |
+public: |
+ |
+ CCLayerTreeHostTestCommit() { } |
+ |
+ virtual void beginTest() |
+ { |
+ m_layerTreeHost->setViewportSize(IntSize(20, 20)); |
+ m_layerTreeHost->setBackgroundColor(Color::gray); |
+ m_layerTreeHost->setPageScaleFactorAndLimits(5, 5, 5); |
+ |
+ postSetNeedsCommitToMainThread(); |
+ } |
+ |
+ virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) |
+ { |
+ EXPECT_EQ(IntSize(20, 20), impl->viewportSize()); |
+ EXPECT_EQ(Color::gray, impl->backgroundColor()); |
+ EXPECT_EQ(5, impl->pageScale()); |
+ |
+ endTest(); |
+ } |
+ |
+ virtual void afterTest() { } |
+}; |
+ |
+TEST_F(CCLayerTreeHostTestCommit, runTest) |
+{ |
+ runTest(true); |
+} |
+ |
// Verifies that startPageScaleAnimation events propagate correctly from CCLayerTreeHost to |
// CCLayerTreeHostImpl in the MT compositor. |
class CCLayerTreeHostTestStartPageScaleAnimation : public CCLayerTreeHostTest { |
@@ -1761,9 +1793,6 @@ |
virtual bool drawsContent() const { return true; } |
- virtual Region visibleContentOpaqueRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); } |
- void setOpaqueContentsRect(const IntRect& opaqueContentsRect) { m_opaqueContentsRect = opaqueContentsRect; } |
- |
const Region& occludedScreenSpace() const { return m_occludedScreenSpace; } |
void clearOccludedScreenSpace() { m_occludedScreenSpace = Region(); } |
@@ -1771,7 +1800,6 @@ |
TestLayerChromium() : LayerChromium() { } |
Region m_occludedScreenSpace; |
- IntRect m_opaqueContentsRect; |
}; |
static void setLayerPropertiesForTesting(TestLayerChromium* layer, LayerChromium* parent, const TransformationMatrix& transform, const FloatPoint& anchor, const FloatPoint& position, const IntSize& bounds, bool opaque) |
@@ -1988,46 +2016,6 @@ |
SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestLayerOcclusion) |
-class CCLayerTreeHostTestContentLayerOcclusion : public CCLayerTreeHostTest { |
-public: |
- CCLayerTreeHostTestContentLayerOcclusion() { } |
- |
- virtual void beginTest() |
- { |
- RefPtr<TestLayerChromium> rootLayer = TestLayerChromium::create(); |
- RefPtr<TestLayerChromium> child = TestLayerChromium::create(); |
- |
- TransformationMatrix identityMatrix; |
- setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true); |
- setLayerPropertiesForTesting(child.get(), rootLayer.get(), identityMatrix, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(50, 50), false); |
- |
- child->setOpaqueContentsRect(IntRect(10, 10, 20, 20)); |
- |
- m_layerTreeHost->setRootLayer(rootLayer); |
- m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
- m_layerTreeHost->updateLayers(); |
- m_layerTreeHost->commitComplete(); |
- |
- EXPECT_EQ_RECT(IntRect(), child->occludedScreenSpace().bounds()); |
- EXPECT_EQ(0u, child->occludedScreenSpace().rects().size()); |
- |
- EXPECT_EQ_RECT(IntRect(40, 40, 20, 20), rootLayer->occludedScreenSpace().bounds()); |
- EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
- |
- // Kill the layerTreeHost immediately. |
- m_layerTreeHost->setRootLayer(0); |
- m_layerTreeHost.clear(); |
- |
- endTest(); |
- } |
- |
- virtual void afterTest() |
- { |
- } |
-}; |
- |
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestContentLayerOcclusion) |
- |
class CCLayerTreeHostTestLayerOcclusionWithFilters : public CCLayerTreeHostTest { |
public: |
CCLayerTreeHostTestLayerOcclusionWithFilters() { } |