diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp b/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp index 1557a7d93..4724b4a43 100644 --- a/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp +++ b/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp @@ -26,13 +26,16 @@ #include "TreeSynchronizer.h" +#include "CCAnimationTestCommon.h" #include "LayerChromium.h" +#include "cc/CCLayerAnimationController.h" #include "cc/CCLayerImpl.h" #include "cc/CCProxy.h" #include "cc/CCSingleThreadProxy.h" #include <gtest/gtest.h> using namespace WebCore; +using namespace WebKitTests; namespace { @@ -91,6 +94,30 @@ private: Vector<int>* m_ccLayerDestructionList; }; +class FakeLayerAnimationController : public CCLayerAnimationController { +public: + static PassOwnPtr<FakeLayerAnimationController> create() + { + return adoptPtr(new FakeLayerAnimationController); + } + + bool synchronizedAnimations() const { return m_synchronizedAnimations; } + +private: + FakeLayerAnimationController() + : m_synchronizedAnimations(false) + { + } + + virtual void synchronizeAnimations(CCLayerAnimationControllerImpl* controllerImpl) + { + CCLayerAnimationController::synchronizeAnimations(controllerImpl); + m_synchronizedAnimations = true; + } + + bool m_synchronizedAnimations; +}; + void expectTreesAreIdentical(LayerChromium* layer, CCLayerImpl* ccLayer) { ASSERT_TRUE(layer); @@ -307,5 +334,19 @@ TEST(TreeSynchronizerTest, syncMaskReplicaAndReplicaMaskLayers) expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); } +TEST(TreeSynchronizerTest, synchronizeAnimations) +{ + DebugScopedSetImplThread impl; + RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create(); + + layerTreeRoot->setLayerAnimationController(FakeLayerAnimationController::create()); + + EXPECT_FALSE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layerAnimationController())->synchronizedAnimations()); + + RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0); + ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot.get()); + + EXPECT_TRUE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layerAnimationController())->synchronizedAnimations()); +} } // namespace |