| 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 "cc/animation/animation_events.h" | 7 #include "cc/animation/animation_events.h" |
| 8 #include "cc/animation/animation_id_provider.h" | 8 #include "cc/animation/animation_id_provider.h" |
| 9 #include "cc/animation/animation_player.h" | 9 #include "cc/animation/animation_player.h" |
| 10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 void AnimationTimelinesTest::ReleaseRefPtrs() { | 228 void AnimationTimelinesTest::ReleaseRefPtrs() { |
| 229 player_ = nullptr; | 229 player_ = nullptr; |
| 230 timeline_ = nullptr; | 230 timeline_ = nullptr; |
| 231 player_impl_ = nullptr; | 231 player_impl_ = nullptr; |
| 232 timeline_impl_ = nullptr; | 232 timeline_impl_ = nullptr; |
| 233 } | 233 } |
| 234 | 234 |
| 235 void AnimationTimelinesTest::AnimateLayersTransferEvents( | 235 void AnimationTimelinesTest::AnimateLayersTransferEvents( |
| 236 base::TimeTicks time, | 236 base::TimeTicks time, |
| 237 unsigned expect_events) { | 237 unsigned expect_events) { |
| 238 scoped_ptr<AnimationEventsVector> events = | 238 scoped_ptr<AnimationEvents> events = |
| 239 host_->animation_registrar()->CreateEvents(); | 239 host_->animation_registrar()->CreateEvents(); |
| 240 | 240 |
| 241 host_impl_->animation_registrar()->AnimateLayers(time); | 241 host_impl_->animation_registrar()->AnimateLayers(time); |
| 242 host_impl_->animation_registrar()->UpdateAnimationState(true, events.get()); | 242 host_impl_->animation_registrar()->UpdateAnimationState(true, events.get()); |
| 243 EXPECT_EQ(expect_events, events->size()); | 243 EXPECT_EQ(expect_events, events->events_.size()); |
| 244 | 244 |
| 245 host_->animation_registrar()->AnimateLayers(time); | 245 host_->animation_registrar()->AnimateLayers(time); |
| 246 host_->animation_registrar()->UpdateAnimationState(true, nullptr); | 246 host_->animation_registrar()->UpdateAnimationState(true, nullptr); |
| 247 host_->animation_registrar()->SetAnimationEvents(std::move(events)); | 247 host_->animation_registrar()->SetAnimationEvents(std::move(events)); |
| 248 } | 248 } |
| 249 | 249 |
| 250 AnimationPlayer* AnimationTimelinesTest::GetPlayerForLayerId(int layer_id) { | 250 AnimationPlayer* AnimationTimelinesTest::GetPlayerForLayerId(int layer_id) { |
| 251 const ElementAnimations* element_animations = | 251 const ElementAnimations* element_animations = |
| 252 host_->GetElementAnimationsForLayerId(layer_id); | 252 host_->GetElementAnimationsForLayerId(layer_id); |
| 253 return element_animations ? element_animations->players_list().head()->value() | 253 return element_animations ? element_animations->players_list().head()->value() |
| 254 : nullptr; | 254 : nullptr; |
| 255 } | 255 } |
| 256 | 256 |
| 257 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { | 257 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { |
| 258 const ElementAnimations* element_animations = | 258 const ElementAnimations* element_animations = |
| 259 host_impl_->GetElementAnimationsForLayerId(layer_id); | 259 host_impl_->GetElementAnimationsForLayerId(layer_id); |
| 260 return element_animations ? element_animations->players_list().head()->value() | 260 return element_animations ? element_animations->players_list().head()->value() |
| 261 : nullptr; | 261 : nullptr; |
| 262 } | 262 } |
| 263 | 263 |
| 264 int AnimationTimelinesTest::NextTestLayerId() { | 264 int AnimationTimelinesTest::NextTestLayerId() { |
| 265 next_test_layer_id_++; | 265 next_test_layer_id_++; |
| 266 return next_test_layer_id_; | 266 return next_test_layer_id_; |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace cc | 269 } // namespace cc |
| OLD | NEW |