Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp

Issue 1739743003: Blink Compositor Animation: Erase old animation system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude histograms.xml Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
index 5a62bb9cc9fdd14b93f4a8561295a19bacb5ad47..0125438af86e76c19d1d4b27363d539bae88a4da 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
@@ -118,69 +118,47 @@ public:
TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations)
{
- ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
+ ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting());
OwnPtr<CompositorFloatAnimationCurve> curve = adoptPtr(CompositorFactory::current().createFloatAnimationCurve());
curve->add(CompositorFloatKeyframe(0.0, 0.0));
OwnPtr<CompositorAnimation> floatAnimation(adoptPtr(CompositorFactory::current().createAnimation(*curve, CompositorTargetProperty::OPACITY)));
int animationId = floatAnimation->id();
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
- OwnPtr<CompositorAnimationTimeline> compositorTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline());
- AnimationPlayerForTesting player;
+ OwnPtr<CompositorAnimationTimeline> compositorTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline());
+ AnimationPlayerForTesting player;
- layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->animationTimeline());
- compositorTimeline->playerAttached(player);
+ layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->animationTimeline());
+ compositorTimeline->playerAttached(player);
- player.compositorPlayer()->attachLayer(m_platformLayer);
- ASSERT_TRUE(player.compositorPlayer()->isLayerAttached());
+ player.compositorPlayer()->attachLayer(m_platformLayer);
+ ASSERT_TRUE(player.compositorPlayer()->isLayerAttached());
- player.compositorPlayer()->addAnimation(floatAnimation.leakPtr());
+ player.compositorPlayer()->addAnimation(floatAnimation.leakPtr());
- ASSERT_TRUE(m_platformLayer->hasActiveAnimation());
+ ASSERT_TRUE(m_platformLayer->hasActiveAnimationForTesting());
- m_graphicsLayer->setShouldFlattenTransform(false);
+ m_graphicsLayer->setShouldFlattenTransform(false);
- m_platformLayer = m_graphicsLayer->platformLayer();
- ASSERT_TRUE(m_platformLayer);
-
- ASSERT_TRUE(m_platformLayer->hasActiveAnimation());
- player.compositorPlayer()->removeAnimation(animationId);
- ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
-
- m_graphicsLayer->setShouldFlattenTransform(true);
-
- m_platformLayer = m_graphicsLayer->platformLayer();
- ASSERT_TRUE(m_platformLayer);
-
- ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
+ m_platformLayer = m_graphicsLayer->platformLayer();
+ ASSERT_TRUE(m_platformLayer);
- player.compositorPlayer()->detachLayer();
- ASSERT_FALSE(player.compositorPlayer()->isLayerAttached());
+ ASSERT_TRUE(m_platformLayer->hasActiveAnimationForTesting());
+ player.compositorPlayer()->removeAnimation(animationId);
+ ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting());
- compositorTimeline->playerDestroyed(player);
- layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->animationTimeline());
- } else {
- ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation->releaseCCAnimation()));
+ m_graphicsLayer->setShouldFlattenTransform(true);
- ASSERT_TRUE(m_platformLayer->hasActiveAnimation());
+ m_platformLayer = m_graphicsLayer->platformLayer();
+ ASSERT_TRUE(m_platformLayer);
- m_graphicsLayer->setShouldFlattenTransform(false);
+ ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting());
- m_platformLayer = m_graphicsLayer->platformLayer();
- ASSERT_TRUE(m_platformLayer);
-
- ASSERT_TRUE(m_platformLayer->hasActiveAnimation());
- m_platformLayer->removeAnimation(animationId);
- ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
-
- m_graphicsLayer->setShouldFlattenTransform(true);
+ player.compositorPlayer()->detachLayer();
+ ASSERT_FALSE(player.compositorPlayer()->isLayerAttached());
- m_platformLayer = m_graphicsLayer->platformLayer();
- ASSERT_TRUE(m_platformLayer);
-
- ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
- }
+ compositorTimeline->playerDestroyed(player);
+ layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->animationTimeline());
}
class FakeScrollableArea : public NoBaseWillBeGarbageCollectedFinalized<FakeScrollableArea>, public ScrollableArea {

Powered by Google App Engine
This is Rietveld 408576698