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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 finished_ = true; | 190 finished_ = true; |
191 } | 191 } |
192 | 192 |
193 AnimationTimelinesTest::AnimationTimelinesTest() | 193 AnimationTimelinesTest::AnimationTimelinesTest() |
194 : client_(ThreadInstance::MAIN), | 194 : client_(ThreadInstance::MAIN), |
195 client_impl_(ThreadInstance::IMPL), | 195 client_impl_(ThreadInstance::IMPL), |
196 host_(nullptr), | 196 host_(nullptr), |
197 host_impl_(nullptr), | 197 host_impl_(nullptr), |
198 timeline_id_(AnimationIdProvider::NextTimelineId()), | 198 timeline_id_(AnimationIdProvider::NextTimelineId()), |
199 player_id_(AnimationIdProvider::NextPlayerId()), | 199 player_id_(AnimationIdProvider::NextPlayerId()), |
200 layer_id_(1) { | 200 next_test_layer_id_(0) { |
201 host_ = client_.host(); | 201 host_ = client_.host(); |
202 host_impl_ = client_impl_.host(); | 202 host_impl_ = client_impl_.host(); |
| 203 |
| 204 layer_id_ = NextTestLayerId(); |
203 } | 205 } |
204 | 206 |
205 AnimationTimelinesTest::~AnimationTimelinesTest() { | 207 AnimationTimelinesTest::~AnimationTimelinesTest() { |
206 } | 208 } |
207 | 209 |
208 void AnimationTimelinesTest::SetUp() { | 210 void AnimationTimelinesTest::SetUp() { |
209 timeline_ = AnimationTimeline::Create(timeline_id_); | 211 timeline_ = AnimationTimeline::Create(timeline_id_); |
210 player_ = AnimationPlayer::Create(player_id_); | 212 player_ = AnimationPlayer::Create(player_id_); |
211 } | 213 } |
212 | 214 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 : nullptr; | 253 : nullptr; |
252 } | 254 } |
253 | 255 |
254 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { | 256 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { |
255 const ElementAnimations* element_animations = | 257 const ElementAnimations* element_animations = |
256 host_impl_->GetElementAnimationsForLayerId(layer_id); | 258 host_impl_->GetElementAnimationsForLayerId(layer_id); |
257 return element_animations ? element_animations->players_list().head()->value() | 259 return element_animations ? element_animations->players_list().head()->value() |
258 : nullptr; | 260 : nullptr; |
259 } | 261 } |
260 | 262 |
| 263 int AnimationTimelinesTest::NextTestLayerId() { |
| 264 next_test_layer_id_++; |
| 265 return next_test_layer_id_; |
| 266 } |
| 267 |
261 } // namespace cc | 268 } // namespace cc |
OLD | NEW |