Index: cc/layer_unittest.cc |
diff --git a/cc/layer_unittest.cc b/cc/layer_unittest.cc |
index 6784858c7fd0f35434d3ff3e13455d88382c31a7..89dc6ffb261463d2d804053acc007c44cde59e8f 100644 |
--- a/cc/layer_unittest.cc |
+++ b/cc/layer_unittest.cc |
@@ -844,30 +844,25 @@ static bool addTestAnimation(Layer* layer) |
return layer->addAnimation(animation.Pass()); |
} |
-TEST(LayerLayerTreeHostTest, shouldNotAddAnimationWithoutLayerTreeHost) |
+TEST(LayerLayerTreeHostTest, shouldNotAddAnimationWithoutAnimationRegistrar) |
{ |
- // Currently, WebCore assumes that animations will be started immediately / very soon |
- // if a composited layer's addAnimation() returns true. However, without a layerTreeHost, |
- // layers cannot actually animate yet. So, to prevent violating this WebCore assumption, |
- // the animation should not be accepted if the layer doesn't already have a layerTreeHost. |
- |
scoped_refptr<Layer> layer = Layer::create(); |
- // Case 1: without a layerTreeHost, the animation should not be accepted. |
-#if defined(OS_ANDROID) |
- // All animations are enabled on Android to avoid performance regressions. |
- // Other platforms will be enabled with http://crbug.com/129683 |
- EXPECT_TRUE(addTestAnimation(layer.get())); |
-#else |
+ // Case 1: without a LayerTreeHost and without an AnimationRegistrar, the |
+ // animation should not be accepted. |
EXPECT_FALSE(addTestAnimation(layer.get())); |
-#endif |
scoped_ptr<FakeLayerImplTreeHost> layerTreeHost(FakeLayerImplTreeHost::create()); |
+ layer->layerAnimationController()->setAnimationRegistrar(layerTreeHost->animationRegistrar()); |
+ |
+ // Case 2: with an AnimationRegistrar, the animation should be accepted. |
+ EXPECT_TRUE(addTestAnimation(layer.get())); |
+ |
layerTreeHost->setRootLayer(layer.get()); |
layer->setLayerTreeHost(layerTreeHost.get()); |
assertLayerTreeHostMatchesForSubtree(layer.get(), layerTreeHost.get()); |
- // Case 2: with a layerTreeHost, the animation should be accepted. |
+ // Case 3: with a LayerTreeHost, the animation should be accepted. |
Ian Vollick
2013/02/25 18:27:29
Maybe we could add a LTH with no registrar and che
|
EXPECT_TRUE(addTestAnimation(layer.get())); |
} |