| 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_timeline.h" | 10 #include "cc/animation/animation_timeline.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 element_id_, ElementListType::ACTIVE, TargetProperty::OPACITY)); | 160 element_id_, ElementListType::ACTIVE, TargetProperty::OPACITY)); |
| 161 EXPECT_FALSE(client_impl_.IsPropertyMutated( | 161 EXPECT_FALSE(client_impl_.IsPropertyMutated( |
| 162 element_id_, ElementListType::ACTIVE, TargetProperty::TRANSFORM)); | 162 element_id_, ElementListType::ACTIVE, TargetProperty::TRANSFORM)); |
| 163 EXPECT_FALSE(client_impl_.IsPropertyMutated( | 163 EXPECT_FALSE(client_impl_.IsPropertyMutated( |
| 164 element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); | 164 element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); |
| 165 | 165 |
| 166 host_impl_->ActivateAnimations(); | 166 host_impl_->ActivateAnimations(); |
| 167 | 167 |
| 168 base::TimeTicks time; | 168 base::TimeTicks time; |
| 169 time += base::TimeDelta::FromSecondsD(0.1); | 169 time += base::TimeDelta::FromSecondsD(0.1); |
| 170 AnimateLayersTransferEvents(time, 3u); | 170 TickAnimationsTransferEvents(time, 3u); |
| 171 EXPECT_TRUE(CheckPlayerTimelineNeedsPushProperties(false)); | 171 EXPECT_TRUE(CheckPlayerTimelineNeedsPushProperties(false)); |
| 172 | 172 |
| 173 time += base::TimeDelta::FromSecondsD(duration); | 173 time += base::TimeDelta::FromSecondsD(duration); |
| 174 AnimateLayersTransferEvents(time, 3u); | 174 TickAnimationsTransferEvents(time, 3u); |
| 175 EXPECT_TRUE(CheckPlayerTimelineNeedsPushProperties(false)); | 175 EXPECT_TRUE(CheckPlayerTimelineNeedsPushProperties(false)); |
| 176 | 176 |
| 177 client_.ExpectOpacityPropertyMutated(element_id_, ElementListType::ACTIVE, | 177 client_.ExpectOpacityPropertyMutated(element_id_, ElementListType::ACTIVE, |
| 178 end_opacity); | 178 end_opacity); |
| 179 client_.ExpectTransformPropertyMutated(element_id_, ElementListType::ACTIVE, | 179 client_.ExpectTransformPropertyMutated(element_id_, ElementListType::ACTIVE, |
| 180 transform_x, transform_y); | 180 transform_x, transform_y); |
| 181 client_.ExpectFilterPropertyMutated(element_id_, ElementListType::ACTIVE, | 181 client_.ExpectFilterPropertyMutated(element_id_, ElementListType::ACTIVE, |
| 182 end_brightness); | 182 end_brightness); |
| 183 | 183 |
| 184 client_impl_.ExpectOpacityPropertyMutated( | 184 client_impl_.ExpectOpacityPropertyMutated( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 host_impl_->ActivateAnimations(); | 241 host_impl_->ActivateAnimations(); |
| 242 | 242 |
| 243 EXPECT_FALSE(delegate1.started()); | 243 EXPECT_FALSE(delegate1.started()); |
| 244 EXPECT_FALSE(delegate1.finished()); | 244 EXPECT_FALSE(delegate1.finished()); |
| 245 | 245 |
| 246 EXPECT_FALSE(delegate2.started()); | 246 EXPECT_FALSE(delegate2.started()); |
| 247 EXPECT_FALSE(delegate2.finished()); | 247 EXPECT_FALSE(delegate2.finished()); |
| 248 | 248 |
| 249 base::TimeTicks time; | 249 base::TimeTicks time; |
| 250 time += base::TimeDelta::FromSecondsD(0.1); | 250 time += base::TimeDelta::FromSecondsD(0.1); |
| 251 AnimateLayersTransferEvents(time, 2u); | 251 TickAnimationsTransferEvents(time, 2u); |
| 252 | 252 |
| 253 EXPECT_TRUE(delegate1.started()); | 253 EXPECT_TRUE(delegate1.started()); |
| 254 EXPECT_FALSE(delegate1.finished()); | 254 EXPECT_FALSE(delegate1.finished()); |
| 255 | 255 |
| 256 EXPECT_TRUE(delegate2.started()); | 256 EXPECT_TRUE(delegate2.started()); |
| 257 EXPECT_FALSE(delegate2.finished()); | 257 EXPECT_FALSE(delegate2.finished()); |
| 258 | 258 |
| 259 EXPECT_FALSE(player1->needs_push_properties()); | 259 EXPECT_FALSE(player1->needs_push_properties()); |
| 260 EXPECT_FALSE(player2->needs_push_properties()); | 260 EXPECT_FALSE(player2->needs_push_properties()); |
| 261 | 261 |
| 262 time += base::TimeDelta::FromSecondsD(duration); | 262 time += base::TimeDelta::FromSecondsD(duration); |
| 263 AnimateLayersTransferEvents(time, 2u); | 263 TickAnimationsTransferEvents(time, 2u); |
| 264 | 264 |
| 265 EXPECT_TRUE(delegate1.finished()); | 265 EXPECT_TRUE(delegate1.finished()); |
| 266 EXPECT_TRUE(delegate2.finished()); | 266 EXPECT_TRUE(delegate2.finished()); |
| 267 | 267 |
| 268 EXPECT_FALSE(player1->needs_push_properties()); | 268 EXPECT_FALSE(player1->needs_push_properties()); |
| 269 EXPECT_FALSE(player2->needs_push_properties()); | 269 EXPECT_FALSE(player2->needs_push_properties()); |
| 270 | 270 |
| 271 client_.ExpectOpacityPropertyMutated(element_id_, ElementListType::ACTIVE, | 271 client_.ExpectOpacityPropertyMutated(element_id_, ElementListType::ACTIVE, |
| 272 end_opacity); | 272 end_opacity); |
| 273 client_.ExpectTransformPropertyMutated(element_id_, ElementListType::ACTIVE, | 273 client_.ExpectTransformPropertyMutated(element_id_, ElementListType::ACTIVE, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 EXPECT_FALSE(client_.IsPropertyMutated(element_id_, ElementListType::ACTIVE, | 327 EXPECT_FALSE(client_.IsPropertyMutated(element_id_, ElementListType::ACTIVE, |
| 328 TargetProperty::FILTER)); | 328 TargetProperty::FILTER)); |
| 329 EXPECT_FALSE(client_impl_.IsPropertyMutated( | 329 EXPECT_FALSE(client_impl_.IsPropertyMutated( |
| 330 element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); | 330 element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); |
| 331 | 331 |
| 332 host_impl_->ActivateAnimations(); | 332 host_impl_->ActivateAnimations(); |
| 333 | 333 |
| 334 base::TimeTicks time; | 334 base::TimeTicks time; |
| 335 time += base::TimeDelta::FromSecondsD(0.1); | 335 time += base::TimeDelta::FromSecondsD(0.1); |
| 336 AnimateLayersTransferEvents(time, 1u); | 336 TickAnimationsTransferEvents(time, 1u); |
| 337 | 337 |
| 338 time += base::TimeDelta::FromSecondsD(duration); | 338 time += base::TimeDelta::FromSecondsD(duration); |
| 339 AnimateLayersTransferEvents(time, 1u); | 339 TickAnimationsTransferEvents(time, 1u); |
| 340 | 340 |
| 341 client_.ExpectOpacityPropertyMutated(element_id_, ElementListType::ACTIVE, | 341 client_.ExpectOpacityPropertyMutated(element_id_, ElementListType::ACTIVE, |
| 342 end_opacity); | 342 end_opacity); |
| 343 client_impl_.ExpectOpacityPropertyMutated( | 343 client_impl_.ExpectOpacityPropertyMutated( |
| 344 element_id_, ElementListType::ACTIVE, end_opacity); | 344 element_id_, ElementListType::ACTIVE, end_opacity); |
| 345 client_impl_.ExpectOpacityPropertyMutated( | 345 client_impl_.ExpectOpacityPropertyMutated( |
| 346 element_id_, ElementListType::PENDING, end_opacity); | 346 element_id_, ElementListType::PENDING, end_opacity); |
| 347 | 347 |
| 348 EXPECT_FALSE(client_.IsPropertyMutated(element_id_, ElementListType::ACTIVE, | 348 EXPECT_FALSE(client_.IsPropertyMutated(element_id_, ElementListType::ACTIVE, |
| 349 TargetProperty::FILTER)); | 349 TargetProperty::FILTER)); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 host_->PushPropertiesTo(host_impl_); | 406 host_->PushPropertiesTo(host_impl_); |
| 407 | 407 |
| 408 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_element_id)); | 408 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_element_id)); |
| 409 EXPECT_TRUE(player_impl_->element_animations()); | 409 EXPECT_TRUE(player_impl_->element_animations()); |
| 410 EXPECT_EQ(player_impl_->element_id(), new_element_id); | 410 EXPECT_EQ(player_impl_->element_id(), new_element_id); |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace | 413 } // namespace |
| 414 } // namespace cc | 414 } // namespace cc |
| OLD | NEW |