| Index: webkit/compositor_bindings/WebLayerTest.cpp
|
| diff --git a/webkit/compositor_bindings/WebLayerTest.cpp b/webkit/compositor_bindings/WebLayerTest.cpp
|
| index 09b26f47d68f185bedca61f4b53db8763a0127d0..52bcf909324a793514bd7caef892be36b26464d5 100644
|
| --- a/webkit/compositor_bindings/WebLayerTest.cpp
|
| +++ b/webkit/compositor_bindings/WebLayerTest.cpp
|
| @@ -6,9 +6,9 @@
|
| #include <public/WebLayer.h>
|
|
|
| #include "CompositorFakeWebGraphicsContext3D.h"
|
| +#include "WebCompositorInitializer.h"
|
| #include "WebLayerImpl.h"
|
| #include "WebLayerTreeViewTestCommon.h"
|
| -#include <public/WebCompositor.h>
|
| #include <public/WebContentLayer.h>
|
| #include <public/WebContentLayerClient.h>
|
| #include <public/WebExternalTextureLayer.h>
|
| @@ -19,6 +19,7 @@
|
| #include <public/WebLayerTreeViewClient.h>
|
| #include <public/WebRect.h>
|
| #include <public/WebSize.h>
|
| +#include <public/WebSolidColorLayer.h>
|
|
|
| #include <gmock/gmock.h>
|
|
|
| @@ -38,10 +39,13 @@ public:
|
|
|
| class WebLayerTest : public Test {
|
| public:
|
| + WebLayerTest()
|
| + : m_compositorInitializer(0)
|
| + {
|
| + }
|
| +
|
| virtual void SetUp()
|
| {
|
| - // Initialize without threading support.
|
| - WebKit::WebCompositor::initialize(0);
|
| m_rootLayer = adoptPtr(WebLayer::create());
|
| EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
|
| EXPECT_TRUE(m_view = adoptPtr(WebLayerTreeView::create(&m_client, *m_rootLayer, WebLayerTreeView::Settings())));
|
| @@ -54,10 +58,10 @@ public:
|
| EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
|
| m_rootLayer.clear();
|
| m_view.clear();
|
| - WebKit::WebCompositor::shutdown();
|
| }
|
|
|
| protected:
|
| + WebKitTests::WebCompositorInitializer m_compositorInitializer;
|
| MockWebLayerTreeViewClient m_client;
|
| OwnPtr<WebLayer> m_rootLayer;
|
| OwnPtr<WebLayerTreeView> m_view;
|
| @@ -120,7 +124,7 @@ TEST_F(WebLayerTest, Client)
|
| EXPECT_EQ(point, layer->position());
|
|
|
| // Texture layer.
|
| - EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
|
| + EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
|
| OwnPtr<WebExternalTextureLayer> textureLayer = adoptPtr(WebExternalTextureLayer::create());
|
| m_rootLayer->addChild(textureLayer->layer());
|
| Mock::VerifyAndClearExpectations(&m_client);
|
| @@ -151,6 +155,13 @@ TEST_F(WebLayerTest, Client)
|
| contentLayer->layer()->setDrawsContent(false);
|
| Mock::VerifyAndClearExpectations(&m_client);
|
| EXPECT_FALSE(contentLayer->layer()->drawsContent());
|
| +
|
| + // Solid color layer.
|
| + EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
|
| + OwnPtr<WebSolidColorLayer> solidColorLayer = adoptPtr(WebSolidColorLayer::create());
|
| + m_rootLayer->addChild(solidColorLayer->layer());
|
| + Mock::VerifyAndClearExpectations(&m_client);
|
| +
|
| }
|
|
|
| class MockScrollClient : public WebLayerScrollClient {
|
|
|