| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/animation/animation_player.h" | 5 #include "cc/animation/animation_player.h" |
| 6 | 6 |
| 7 #include "cc/animation/animation_delegate.h" | 7 #include "cc/animation/animation_delegate.h" |
| 8 #include "cc/animation/animation_host.h" | 8 #include "cc/animation/animation_host.h" |
| 9 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
| 10 #include "cc/animation/animation_registrar.h" | |
| 11 #include "cc/animation/animation_timeline.h" | 10 #include "cc/animation/animation_timeline.h" |
| 12 #include "cc/animation/element_animations.h" | 11 #include "cc/animation/element_animations.h" |
| 13 #include "cc/test/animation_test_common.h" | 12 #include "cc/test/animation_test_common.h" |
| 14 #include "cc/test/animation_timelines_test_common.h" | 13 #include "cc/test/animation_timelines_test_common.h" |
| 15 | 14 |
| 16 namespace cc { | 15 namespace cc { |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 class AnimationPlayerTest : public AnimationTimelinesTest { | 18 class AnimationPlayerTest : public AnimationTimelinesTest { |
| 20 public: | 19 public: |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 EXPECT_FALSE(client_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 128 EXPECT_FALSE(client_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 130 TargetProperty::FILTER)); | 129 TargetProperty::FILTER)); |
| 131 | 130 |
| 132 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 131 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 133 TargetProperty::OPACITY)); | 132 TargetProperty::OPACITY)); |
| 134 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 133 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 135 TargetProperty::TRANSFORM)); | 134 TargetProperty::TRANSFORM)); |
| 136 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 135 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 137 TargetProperty::FILTER)); | 136 TargetProperty::FILTER)); |
| 138 | 137 |
| 139 host_impl_->animation_registrar()->ActivateAnimations(); | 138 host_impl_->ActivateAnimations(); |
| 140 | 139 |
| 141 base::TimeTicks time; | 140 base::TimeTicks time; |
| 142 time += base::TimeDelta::FromSecondsD(0.1); | 141 time += base::TimeDelta::FromSecondsD(0.1); |
| 143 AnimateLayersTransferEvents(time, 3u); | 142 AnimateLayersTransferEvents(time, 3u); |
| 144 | 143 |
| 145 time += base::TimeDelta::FromSecondsD(duration); | 144 time += base::TimeDelta::FromSecondsD(duration); |
| 146 AnimateLayersTransferEvents(time, 3u); | 145 AnimateLayersTransferEvents(time, 3u); |
| 147 | 146 |
| 148 client_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 147 client_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 149 end_opacity); | 148 end_opacity); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 const int transform_y = 20; | 197 const int transform_y = 20; |
| 199 | 198 |
| 200 const double duration = 1.; | 199 const double duration = 1.; |
| 201 | 200 |
| 202 AddOpacityTransitionToPlayer(player1.get(), duration, start_opacity, | 201 AddOpacityTransitionToPlayer(player1.get(), duration, start_opacity, |
| 203 end_opacity, false); | 202 end_opacity, false); |
| 204 AddAnimatedTransformToPlayer(player2.get(), duration, transform_x, | 203 AddAnimatedTransformToPlayer(player2.get(), duration, transform_x, |
| 205 transform_y); | 204 transform_y); |
| 206 | 205 |
| 207 host_->PushPropertiesTo(host_impl_); | 206 host_->PushPropertiesTo(host_impl_); |
| 208 host_impl_->animation_registrar()->ActivateAnimations(); | 207 host_impl_->ActivateAnimations(); |
| 209 | 208 |
| 210 EXPECT_FALSE(delegate1.started_); | 209 EXPECT_FALSE(delegate1.started_); |
| 211 EXPECT_FALSE(delegate1.finished_); | 210 EXPECT_FALSE(delegate1.finished_); |
| 212 | 211 |
| 213 EXPECT_FALSE(delegate2.started_); | 212 EXPECT_FALSE(delegate2.started_); |
| 214 EXPECT_FALSE(delegate2.finished_); | 213 EXPECT_FALSE(delegate2.finished_); |
| 215 | 214 |
| 216 base::TimeTicks time; | 215 base::TimeTicks time; |
| 217 time += base::TimeDelta::FromSecondsD(0.1); | 216 time += base::TimeDelta::FromSecondsD(0.1); |
| 218 AnimateLayersTransferEvents(time, 2u); | 217 AnimateLayersTransferEvents(time, 2u); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 EXPECT_FALSE(client_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 279 EXPECT_FALSE(client_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 281 TargetProperty::OPACITY)); | 280 TargetProperty::OPACITY)); |
| 282 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 281 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 283 TargetProperty::OPACITY)); | 282 TargetProperty::OPACITY)); |
| 284 | 283 |
| 285 EXPECT_FALSE(client_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 284 EXPECT_FALSE(client_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 286 TargetProperty::FILTER)); | 285 TargetProperty::FILTER)); |
| 287 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 286 EXPECT_FALSE(client_impl_.IsPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 288 TargetProperty::FILTER)); | 287 TargetProperty::FILTER)); |
| 289 | 288 |
| 290 host_impl_->animation_registrar()->ActivateAnimations(); | 289 host_impl_->ActivateAnimations(); |
| 291 | 290 |
| 292 base::TimeTicks time; | 291 base::TimeTicks time; |
| 293 time += base::TimeDelta::FromSecondsD(0.1); | 292 time += base::TimeDelta::FromSecondsD(0.1); |
| 294 AnimateLayersTransferEvents(time, 1u); | 293 AnimateLayersTransferEvents(time, 1u); |
| 295 | 294 |
| 296 time += base::TimeDelta::FromSecondsD(duration); | 295 time += base::TimeDelta::FromSecondsD(duration); |
| 297 AnimateLayersTransferEvents(time, 1u); | 296 AnimateLayersTransferEvents(time, 1u); |
| 298 | 297 |
| 299 client_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE, | 298 client_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE, |
| 300 end_opacity); | 299 end_opacity); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 360 |
| 362 host_->PushPropertiesTo(host_impl_); | 361 host_->PushPropertiesTo(host_impl_); |
| 363 | 362 |
| 364 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_layer_id)); | 363 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_layer_id)); |
| 365 EXPECT_TRUE(player_impl_->element_animations()); | 364 EXPECT_TRUE(player_impl_->element_animations()); |
| 366 EXPECT_EQ(player_impl_->layer_id(), new_layer_id); | 365 EXPECT_EQ(player_impl_->layer_id(), new_layer_id); |
| 367 } | 366 } |
| 368 | 367 |
| 369 } // namespace | 368 } // namespace |
| 370 } // namespace cc | 369 } // namespace cc |
| OLD | NEW |