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

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

Issue 1539233002: CC Animations: Fix the case when main-thread player changes layer_id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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') | no next file » | 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 "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
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
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
OLDNEW
« no previous file with comments | « cc/test/animation_timelines_test_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698