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

Side by Side Diff: cc/animation/animation_player_unittest.cc

Issue 1904653002: CC Animation: Merge LayerAnimationController into ElementAnimations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor optimization: Don't init value observations if same host. Created 4 years, 8 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/animation/animation_player.cc ('k') | cc/animation/element_animations.h » ('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/animation/animation_player.h" 5 #include "cc/animation/animation_player.h"
6 6
7 #include "cc/animation/animation_delegate.h" 7 #include "cc/animation/animation_delegate.h"
8 #include "cc/animation/animation_host.h" 8 #include "cc/animation/animation_host.h"
9 #include "cc/animation/animation_id_provider.h" 9 #include "cc/animation/animation_id_provider.h"
10 #include "cc/animation/animation_timeline.h" 10 #include "cc/animation/animation_timeline.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const double duration = 1.; 199 const double duration = 1.;
200 200
201 AddOpacityTransitionToPlayer(player1.get(), duration, start_opacity, 201 AddOpacityTransitionToPlayer(player1.get(), duration, start_opacity,
202 end_opacity, false); 202 end_opacity, false);
203 AddAnimatedTransformToPlayer(player2.get(), duration, transform_x, 203 AddAnimatedTransformToPlayer(player2.get(), duration, transform_x,
204 transform_y); 204 transform_y);
205 205
206 host_->PushPropertiesTo(host_impl_); 206 host_->PushPropertiesTo(host_impl_);
207 host_impl_->ActivateAnimations(); 207 host_impl_->ActivateAnimations();
208 208
209 EXPECT_FALSE(delegate1.started_); 209 EXPECT_FALSE(delegate1.started());
210 EXPECT_FALSE(delegate1.finished_); 210 EXPECT_FALSE(delegate1.finished());
211 211
212 EXPECT_FALSE(delegate2.started_); 212 EXPECT_FALSE(delegate2.started());
213 EXPECT_FALSE(delegate2.finished_); 213 EXPECT_FALSE(delegate2.finished());
214 214
215 base::TimeTicks time; 215 base::TimeTicks time;
216 time += base::TimeDelta::FromSecondsD(0.1); 216 time += base::TimeDelta::FromSecondsD(0.1);
217 AnimateLayersTransferEvents(time, 2u); 217 AnimateLayersTransferEvents(time, 2u);
218 218
219 EXPECT_TRUE(delegate1.started_); 219 EXPECT_TRUE(delegate1.started());
220 EXPECT_FALSE(delegate1.finished_); 220 EXPECT_FALSE(delegate1.finished());
221 221
222 EXPECT_TRUE(delegate2.started_); 222 EXPECT_TRUE(delegate2.started());
223 EXPECT_FALSE(delegate2.finished_); 223 EXPECT_FALSE(delegate2.finished());
224 224
225 time += base::TimeDelta::FromSecondsD(duration); 225 time += base::TimeDelta::FromSecondsD(duration);
226 AnimateLayersTransferEvents(time, 2u); 226 AnimateLayersTransferEvents(time, 2u);
227 227
228 EXPECT_TRUE(delegate1.finished_); 228 EXPECT_TRUE(delegate1.finished());
229 EXPECT_TRUE(delegate2.finished_); 229 EXPECT_TRUE(delegate2.finished());
230 230
231 client_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE, 231 client_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE,
232 end_opacity); 232 end_opacity);
233 client_.ExpectTransformPropertyMutated(layer_id_, LayerTreeType::ACTIVE, 233 client_.ExpectTransformPropertyMutated(layer_id_, LayerTreeType::ACTIVE,
234 transform_x, transform_y); 234 transform_x, transform_y);
235 235
236 client_impl_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE, 236 client_impl_.ExpectOpacityPropertyMutated(layer_id_, LayerTreeType::ACTIVE,
237 end_opacity); 237 end_opacity);
238 client_impl_.ExpectTransformPropertyMutated(layer_id_, LayerTreeType::ACTIVE, 238 client_impl_.ExpectTransformPropertyMutated(layer_id_, LayerTreeType::ACTIVE,
239 transform_x, transform_y); 239 transform_x, transform_y);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 host_->PushPropertiesTo(host_impl_); 359 host_->PushPropertiesTo(host_impl_);
360 360
361 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_layer_id)); 361 EXPECT_EQ(player_impl_, GetImplPlayerForLayerId(new_layer_id));
362 EXPECT_TRUE(player_impl_->element_animations()); 362 EXPECT_TRUE(player_impl_->element_animations());
363 EXPECT_EQ(player_impl_->layer_id(), new_layer_id); 363 EXPECT_EQ(player_impl_->layer_id(), new_layer_id);
364 } 364 }
365 365
366 } // namespace 366 } // namespace
367 } // namespace cc 367 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_player.cc ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698