| 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/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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 host_impl_->AnimateLayers(time); | 239 host_impl_->AnimateLayers(time); |
| 240 host_impl_->UpdateAnimationState(true, events.get()); | 240 host_impl_->UpdateAnimationState(true, events.get()); |
| 241 EXPECT_EQ(expect_events, events->events_.size()); | 241 EXPECT_EQ(expect_events, events->events_.size()); |
| 242 | 242 |
| 243 host_->AnimateLayers(time); | 243 host_->AnimateLayers(time); |
| 244 host_->UpdateAnimationState(true, nullptr); | 244 host_->UpdateAnimationState(true, nullptr); |
| 245 host_->SetAnimationEvents(std::move(events)); | 245 host_->SetAnimationEvents(std::move(events)); |
| 246 } | 246 } |
| 247 | 247 |
| 248 AnimationPlayer* AnimationTimelinesTest::GetPlayerForLayerId(int layer_id) { | 248 AnimationPlayer* AnimationTimelinesTest::GetPlayerForLayerId(int layer_id) { |
| 249 const ElementAnimations* element_animations = | 249 const scoped_refptr<ElementAnimations> element_animations = |
| 250 host_->GetElementAnimationsForLayerId(layer_id); | 250 host_->GetElementAnimationsForLayerId(layer_id); |
| 251 return element_animations ? element_animations->players_list().head()->value() | 251 return element_animations ? element_animations->players_list().head()->value() |
| 252 : nullptr; | 252 : nullptr; |
| 253 } | 253 } |
| 254 | 254 |
| 255 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { | 255 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { |
| 256 const ElementAnimations* element_animations = | 256 const scoped_refptr<ElementAnimations> element_animations = |
| 257 host_impl_->GetElementAnimationsForLayerId(layer_id); | 257 host_impl_->GetElementAnimationsForLayerId(layer_id); |
| 258 return element_animations ? element_animations->players_list().head()->value() | 258 return element_animations ? element_animations->players_list().head()->value() |
| 259 : nullptr; | 259 : nullptr; |
| 260 } | 260 } |
| 261 | 261 |
| 262 int AnimationTimelinesTest::NextTestLayerId() { | 262 int AnimationTimelinesTest::NextTestLayerId() { |
| 263 next_test_layer_id_++; | 263 next_test_layer_id_++; |
| 264 return next_test_layer_id_; | 264 return next_test_layer_id_; |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace cc | 267 } // namespace cc |
| OLD | NEW |