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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 EXPECT_FALSE(client_impl_.IsPropertyMutated( | 305 EXPECT_FALSE(client_impl_.IsPropertyMutated( |
306 element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); | 306 element_id_, ElementListType::ACTIVE, TargetProperty::FILTER)); |
307 } | 307 } |
308 | 308 |
309 TEST_F(AnimationPlayerTest, AddRemoveAnimationCausesSetNeedsCommit) { | 309 TEST_F(AnimationPlayerTest, AddRemoveAnimationCausesSetNeedsCommit) { |
310 client_.RegisterElement(element_id_, ElementListType::ACTIVE); | 310 client_.RegisterElement(element_id_, ElementListType::ACTIVE); |
311 host_->AddAnimationTimeline(timeline_); | 311 host_->AddAnimationTimeline(timeline_); |
312 timeline_->AttachPlayer(player_); | 312 timeline_->AttachPlayer(player_); |
313 player_->AttachElement(element_id_); | 313 player_->AttachElement(element_id_); |
314 | 314 |
315 EXPECT_FALSE(client_.mutators_need_commit()); | 315 EXPECT_TRUE(client_.mutators_need_commit()); |
| 316 client_.set_mutators_need_commit(false); |
316 | 317 |
317 const int animation_id = | 318 const int animation_id = |
318 AddOpacityTransitionToPlayer(player_.get(), 1., .7f, .3f, false); | 319 AddOpacityTransitionToPlayer(player_.get(), 1., .7f, .3f, false); |
319 | 320 |
320 EXPECT_TRUE(client_.mutators_need_commit()); | 321 EXPECT_TRUE(client_.mutators_need_commit()); |
321 client_.set_mutators_need_commit(false); | 322 client_.set_mutators_need_commit(false); |
322 | 323 |
323 player_->PauseAnimation(animation_id, 1.); | 324 player_->PauseAnimation(animation_id, 1.); |
324 EXPECT_TRUE(client_.mutators_need_commit()); | 325 EXPECT_TRUE(client_.mutators_need_commit()); |
325 client_.set_mutators_need_commit(false); | 326 client_.set_mutators_need_commit(false); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 359 |
359 host_->PushPropertiesTo(host_impl_); | 360 host_->PushPropertiesTo(host_impl_); |
360 | 361 |
361 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_element_id)); | 362 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_element_id)); |
362 EXPECT_TRUE(player_impl_->element_animations()); | 363 EXPECT_TRUE(player_impl_->element_animations()); |
363 EXPECT_EQ(player_impl_->element_id(), new_element_id); | 364 EXPECT_EQ(player_impl_->element_id(), new_element_id); |
364 } | 365 } |
365 | 366 |
366 } // namespace | 367 } // namespace |
367 } // namespace cc | 368 } // namespace cc |
OLD | NEW |