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

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

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
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/element_animations.h" 5 #include "cc/animation/element_animations.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_player.h" 10 #include "cc/animation/animation_player.h"
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000)); 1181 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
1182 animations->UpdateState(true, events.get()); 1182 animations->UpdateState(true, events.get());
1183 EXPECT_TRUE(animations->HasActiveAnimation()); 1183 EXPECT_TRUE(animations->HasActiveAnimation());
1184 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); 1184 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
1185 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000)); 1185 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
1186 animations->UpdateState(true, events.get()); 1186 animations->UpdateState(true, events.get());
1187 EXPECT_TRUE(animations->HasActiveAnimation()); 1187 EXPECT_TRUE(animations->HasActiveAnimation());
1188 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); 1188 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
1189 1189
1190 // Send the synchronized start time. 1190 // Send the synchronized start time.
1191 animations->NotifyAnimationStarted( 1191 animations->NotifyAnimationStarted(AnimationEvent(
1192 AnimationEvent(AnimationEvent::STARTED, 0, 1, TargetProperty::OPACITY, 1192 AnimationEvent::STARTED, ElementId(), 1, TargetProperty::OPACITY,
1193 kInitialTickTime + TimeDelta::FromMilliseconds(2000))); 1193 kInitialTickTime + TimeDelta::FromMilliseconds(2000)));
1194 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(5000)); 1194 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(5000));
1195 animations->UpdateState(true, events.get()); 1195 animations->UpdateState(true, events.get());
1196 EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); 1196 EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
1197 EXPECT_FALSE(animations->HasActiveAnimation()); 1197 EXPECT_FALSE(animations->HasActiveAnimation());
1198 } 1198 }
1199 1199
1200 // Tests that two queued animations affecting the same property run in sequence. 1200 // Tests that two queued animations affecting the same property run in sequence.
1201 TEST_F(ElementAnimationsTest, TrivialQueuing) { 1201 TEST_F(ElementAnimationsTest, TrivialQueuing) {
1202 CreateTestLayer(false, false); 1202 CreateTestLayer(false, false);
1203 AttachTimelinePlayerLayer(); 1203 AttachTimelinePlayerLayer();
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
3389 EXPECT_FALSE(animations->IsPotentiallyAnimatingProperty( 3389 EXPECT_FALSE(animations->IsPotentiallyAnimatingProperty(
3390 TargetProperty::OPACITY, ElementListType::ACTIVE)); 3390 TargetProperty::OPACITY, ElementListType::ACTIVE));
3391 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty( 3391 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty(
3392 TargetProperty::OPACITY, ElementListType::PENDING)); 3392 TargetProperty::OPACITY, ElementListType::PENDING));
3393 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty( 3393 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty(
3394 TargetProperty::OPACITY, ElementListType::ACTIVE)); 3394 TargetProperty::OPACITY, ElementListType::ACTIVE));
3395 } 3395 }
3396 3396
3397 } // namespace 3397 } // namespace
3398 } // namespace cc 3398 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698