diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-27 09:07:56 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-27 08:12:41 +0000 |
commit | 98ff39cb35ef2bd32bb1af9565628a4a4b0979b2 (patch) | |
tree | 151fe6c7d22b64f237f2f452cc72b581274a02d6 /chromium/cc/layers/layer_unittest.cc | |
parent | af3d4809763ef308f08ced947a73b624729ac7ea (diff) |
BASELINE: Update Chromium to 47.0.2526.34 and Ninja to 1.6.0
Change-Id: Ie8863b493c7ff19eb46478935dfe7602679b227e
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'chromium/cc/layers/layer_unittest.cc')
-rw-r--r-- | chromium/cc/layers/layer_unittest.cc | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/chromium/cc/layers/layer_unittest.cc b/chromium/cc/layers/layer_unittest.cc index 10b1d147eaf..6f81e8e8483 100644 --- a/chromium/cc/layers/layer_unittest.cc +++ b/chromium/cc/layers/layer_unittest.cc @@ -867,7 +867,7 @@ TEST_F(LayerTest, MaskAndReplicaHasParent) { EXPECT_EQ(replica.get(), replica->mask_layer()->parent()); } -TEST_F(LayerTest, CheckTranformIsInvertible) { +TEST_F(LayerTest, CheckTransformIsInvertible) { scoped_refptr<Layer> layer = Layer::Create(layer_settings_); scoped_ptr<LayerImpl> impl_layer = LayerImpl::Create(host_impl_.active_tree(), 1); @@ -898,7 +898,7 @@ TEST_F(LayerTest, CheckTranformIsInvertible) { Mock::VerifyAndClearExpectations(layer_tree_host_.get()); } -TEST_F(LayerTest, TranformIsInvertibleAnimation) { +TEST_F(LayerTest, TransformIsInvertibleAnimation) { scoped_refptr<Layer> layer = Layer::Create(layer_settings_); scoped_ptr<LayerImpl> impl_layer = LayerImpl::Create(host_impl_.active_tree(), 1); @@ -920,9 +920,9 @@ TEST_F(LayerTest, TranformIsInvertibleAnimation) { gfx::Transform identity_transform; + EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1); layer->SetTransform(identity_transform); - static_cast<LayerAnimationValueObserver*>(layer.get()) - ->OnTransformAnimated(singular_transform); + layer->OnTransformAnimated(singular_transform); layer->PushPropertiesTo(impl_layer.get()); EXPECT_FALSE(layer->transform_is_invertible()); EXPECT_FALSE(impl_layer->transform_is_invertible()); @@ -1326,5 +1326,26 @@ TEST_F(LayerTest, DedupesCopyOutputRequestsBySource) { EXPECT_EQ(1, did_receive_second_result_from_this_source); } +TEST_F(LayerTest, AnimationSchedulesLayerUpdate) { + scoped_refptr<Layer> layer = Layer::Create(layer_settings_); + EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(layer)); + + EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1); + layer->OnOpacityAnimated(0.5f); + Mock::VerifyAndClearExpectations(layer_tree_host_.get()); + + EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1); + gfx::Transform transform; + transform.Rotate(45.0); + layer->OnTransformAnimated(transform); + Mock::VerifyAndClearExpectations(layer_tree_host_.get()); + + // Scroll offset animation should not schedule a layer update since it is + // handled similarly to normal compositor scroll updates. + EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(0); + layer->OnScrollOffsetAnimated(gfx::ScrollOffset(10, 10)); + Mock::VerifyAndClearExpectations(layer_tree_host_.get()); +} + } // namespace } // namespace cc |