summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
commit284837daa07b29d6a63a748544a90b1f5842ac5c (patch)
treeecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebKit/chromium/tests/LayerChromiumTest.cpp
parent2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff)
downloadqtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/WebKit/chromium/tests/LayerChromiumTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/LayerChromiumTest.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
index 0e6eb0eb4..a17b076f3 100644
--- a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
@@ -26,15 +26,15 @@
#include "LayerChromium.h"
+#include "CCGeometryTestUtils.h"
#include "CCLayerImpl.h"
#include "CCLayerTreeHost.h"
-#include "CCLayerTreeTestCommon.h"
#include "CCSingleThreadProxy.h"
#include "FakeCCLayerTreeHostClient.h"
#include "LayerPainterChromium.h"
+#include "WebCompositorInitializer.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-#include <public/WebCompositor.h>
#include <public/WebTransformationMatrix.h>
using namespace WebCore;
@@ -74,11 +74,15 @@ public:
class LayerChromiumTest : public testing::Test {
+public:
+ LayerChromiumTest()
+ : m_compositorInitializer(0)
+ {
+ }
+
protected:
virtual void SetUp()
{
- // Initialize without threading support.
- WebKit::WebCompositor::initialize(0);
m_layerTreeHost = adoptPtr(new MockCCLayerTreeHost);
}
@@ -96,7 +100,6 @@ protected:
m_layerTreeHost->setRootLayer(0);
m_layerTreeHost.clear();
- WebKit::WebCompositor::shutdown();
}
void verifyTestTreeInitialState() const
@@ -149,6 +152,7 @@ protected:
OwnPtr<MockCCLayerTreeHost> m_layerTreeHost;
RefPtr<LayerChromium> m_parent, m_child1, m_child2, m_child3, m_grandChild1, m_grandChild2, m_grandChild3;
+ WebCompositorInitializer m_compositorInitializer;
};
TEST_F(LayerChromiumTest, basicCreateAndDestroy)
@@ -635,7 +639,7 @@ void assertLayerTreeHostMatchesForSubtree(LayerChromium* layer, CCLayerTreeHost*
TEST(LayerChromiumLayerTreeHostTest, enteringTree)
{
- WebKit::WebCompositor::initialize(0);
+ WebCompositorInitializer compositorInitializer(0);
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromium> mask = LayerChromium::create();
@@ -662,12 +666,11 @@ TEST(LayerChromiumLayerTreeHostTest, enteringTree)
assertLayerTreeHostMatchesForSubtree(parent.get(), 0);
layerTreeHost.clear();
- WebKit::WebCompositor::shutdown();
}
TEST(LayerChromiumLayerTreeHostTest, addingLayerSubtree)
{
- WebKit::WebCompositor::initialize(0);
+ WebCompositorInitializer compositorInitializer(0);
RefPtr<LayerChromium> parent = LayerChromium::create();
OwnPtr<FakeCCLayerTreeHost> layerTreeHost(FakeCCLayerTreeHost::create());
@@ -693,12 +696,11 @@ TEST(LayerChromiumLayerTreeHostTest, addingLayerSubtree)
layerTreeHost->setRootLayer(0);
layerTreeHost.clear();
- WebKit::WebCompositor::shutdown();
}
TEST(LayerChromiumLayerTreeHostTest, changeHost)
{
- WebKit::WebCompositor::initialize(0);
+ WebCompositorInitializer compositorInitializer(0);
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromium> mask = LayerChromium::create();
@@ -726,12 +728,11 @@ TEST(LayerChromiumLayerTreeHostTest, changeHost)
secondLayerTreeHost->setRootLayer(0);
firstLayerTreeHost.clear();
secondLayerTreeHost.clear();
- WebKit::WebCompositor::shutdown();
}
TEST(LayerChromiumLayerTreeHostTest, changeHostInSubtree)
{
- WebKit::WebCompositor::initialize(0);
+ WebCompositorInitializer compositorInitializer(0);
RefPtr<LayerChromium> firstParent = LayerChromium::create();
RefPtr<LayerChromium> firstChild = LayerChromium::create();
RefPtr<LayerChromium> secondParent = LayerChromium::create();
@@ -763,12 +764,11 @@ TEST(LayerChromiumLayerTreeHostTest, changeHostInSubtree)
secondLayerTreeHost->setRootLayer(0);
firstLayerTreeHost.clear();
secondLayerTreeHost.clear();
- WebKit::WebCompositor::shutdown();
}
TEST(LayerChromiumLayerTreeHostTest, replaceMaskAndReplicaLayer)
{
- WebKit::WebCompositor::initialize(0);
+ WebCompositorInitializer compositorInitializer(0);
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> mask = LayerChromium::create();
RefPtr<LayerChromium> replica = LayerChromium::create();
@@ -800,19 +800,17 @@ TEST(LayerChromiumLayerTreeHostTest, replaceMaskAndReplicaLayer)
// Test over, cleanup time.
layerTreeHost->setRootLayer(0);
layerTreeHost.clear();
- WebKit::WebCompositor::shutdown();
}
TEST(LayerChromiumLayerTreeHostTest, destroyHostWithNonNullRootLayer)
{
- WebKit::WebCompositor::initialize(0);
+ WebCompositorInitializer compositorInitializer(0);
RefPtr<LayerChromium> root = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
root->addChild(child);
OwnPtr<FakeCCLayerTreeHost> layerTreeHost(FakeCCLayerTreeHost::create());
layerTreeHost->setRootLayer(root);
layerTreeHost.clear();
- WebKit::WebCompositor::shutdown();
}
class MockLayerChromium : public LayerChromium {