Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: cc/test/animation_timelines_test_common.cc

Issue 2377223002: CC Animations: Rewrite unit tests to work with AnimationPlayer. (Closed)
Patch Set: Reparent. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/animation_timelines_test_common.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test/animation_timelines_test_common.h" 5 #include "cc/test/animation_timelines_test_common.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/animation/animation_events.h" 8 #include "cc/animation/animation_events.h"
9 #include "cc/animation/animation_id_provider.h" 9 #include "cc/animation/animation_id_provider.h"
10 #include "cc/animation/animation_player.h" 10 #include "cc/animation/animation_player.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 void AnimationTimelinesTest::CreateTestImplLayer( 389 void AnimationTimelinesTest::CreateTestImplLayer(
390 ElementListType element_list_type) { 390 ElementListType element_list_type) {
391 client_impl_.RegisterElement(element_id_, element_list_type); 391 client_impl_.RegisterElement(element_id_, element_list_type);
392 } 392 }
393 393
394 void AnimationTimelinesTest::AttachTimelinePlayerLayer() { 394 void AnimationTimelinesTest::AttachTimelinePlayerLayer() {
395 host_->AddAnimationTimeline(timeline_); 395 host_->AddAnimationTimeline(timeline_);
396 timeline_->AttachPlayer(player_); 396 timeline_->AttachPlayer(player_);
397 player_->AttachElement(element_id_); 397 player_->AttachElement(element_id_);
398
399 element_animations_ = player_->element_animations();
398 } 400 }
399 401
400 void AnimationTimelinesTest::CreateImplTimelineAndPlayer() { 402 void AnimationTimelinesTest::CreateImplTimelineAndPlayer() {
401 host_->PushPropertiesTo(host_impl_); 403 host_->PushPropertiesTo(host_impl_);
402 GetImplTimelineAndPlayerByID(); 404 GetImplTimelineAndPlayerByID();
403 } 405 }
404 406
405 scoped_refptr<ElementAnimations> AnimationTimelinesTest::element_animations()
406 const {
407 DCHECK(player_);
408 DCHECK(player_->element_animations());
409 return player_->element_animations();
410 }
411
412 scoped_refptr<ElementAnimations>
413 AnimationTimelinesTest::element_animations_impl() const {
414 DCHECK(player_impl_);
415 DCHECK(player_impl_->element_animations());
416 return player_impl_->element_animations();
417 }
418
419 void AnimationTimelinesTest::GetImplTimelineAndPlayerByID() { 407 void AnimationTimelinesTest::GetImplTimelineAndPlayerByID() {
420 timeline_impl_ = host_impl_->GetTimelineById(timeline_id_); 408 timeline_impl_ = host_impl_->GetTimelineById(timeline_id_);
421 EXPECT_TRUE(timeline_impl_); 409 EXPECT_TRUE(timeline_impl_);
422 player_impl_ = timeline_impl_->GetPlayerById(player_id_); 410 player_impl_ = timeline_impl_->GetPlayerById(player_id_);
423 EXPECT_TRUE(player_impl_); 411 EXPECT_TRUE(player_impl_);
412
413 element_animations_impl_ = player_impl_->element_animations();
424 } 414 }
425 415
426 void AnimationTimelinesTest::ReleaseRefPtrs() { 416 void AnimationTimelinesTest::ReleaseRefPtrs() {
427 player_ = nullptr; 417 player_ = nullptr;
428 timeline_ = nullptr; 418 timeline_ = nullptr;
429 player_impl_ = nullptr; 419 player_impl_ = nullptr;
430 timeline_impl_ = nullptr; 420 timeline_impl_ = nullptr;
431 } 421 }
432 422
433 void AnimationTimelinesTest::AnimateLayersTransferEvents( 423 void AnimationTimelinesTest::AnimateLayersTransferEvents(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 488 }
499 489
500 return result; 490 return result;
501 } 491 }
502 492
503 void AnimationTimelinesTest::PushProperties() { 493 void AnimationTimelinesTest::PushProperties() {
504 host_->PushPropertiesTo(host_impl_); 494 host_->PushPropertiesTo(host_impl_);
505 } 495 }
506 496
507 } // namespace cc 497 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/animation_timelines_test_common.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698