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

Unified Diff: cc/test/animation_timelines_test_common.cc

Issue 2189813002: ElementAnimations should hold an ObservableList of AnimationPlayers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused file Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: cc/test/animation_timelines_test_common.cc
diff --git a/cc/test/animation_timelines_test_common.cc b/cc/test/animation_timelines_test_common.cc
index e9377635582c17dcfc4ceeaad7445f4a76c15594..9cb8f9b10381ba2fbc9b029840573a2a9405188a 100644
--- a/cc/test/animation_timelines_test_common.cc
+++ b/cc/test/animation_timelines_test_common.cc
@@ -355,17 +355,17 @@ TestLayer* TestHostClient::FindTestLayer(ElementId element_id,
}
TestAnimationDelegate::TestAnimationDelegate()
- : started_(false),
- finished_(false),
- aborted_(false),
- takeover_(false),
+ : started_(0),
+ finished_(0),
+ aborted_(0),
+ takeover_(0),
start_time_(base::TimeTicks()) {}
void TestAnimationDelegate::NotifyAnimationStarted(
base::TimeTicks monotonic_time,
TargetProperty::Type target_property,
int group) {
- started_ = true;
+ started_++;
start_time_ = monotonic_time;
}
@@ -373,14 +373,14 @@ void TestAnimationDelegate::NotifyAnimationFinished(
base::TimeTicks monotonic_time,
TargetProperty::Type target_property,
int group) {
- finished_ = true;
+ finished_++;
}
void TestAnimationDelegate::NotifyAnimationAborted(
base::TimeTicks monotonic_time,
TargetProperty::Type target_property,
int group) {
- aborted_ = true;
+ aborted_++;
}
void TestAnimationDelegate::NotifyAnimationTakeover(
@@ -388,7 +388,7 @@ void TestAnimationDelegate::NotifyAnimationTakeover(
TargetProperty::Type target_property,
double animation_start_time,
std::unique_ptr<AnimationCurve> curve) {
- takeover_ = true;
+ takeover_++;
}
AnimationTimelinesTest::AnimationTimelinesTest()
@@ -495,16 +495,22 @@ AnimationPlayer* AnimationTimelinesTest::GetPlayerForElementId(
ElementId element_id) {
const scoped_refptr<ElementAnimations> element_animations =
host_->GetElementAnimationsForElementId(element_id);
- return element_animations ? element_animations->players_list().head()->value()
- : nullptr;
+ return element_animations
+ ? base::ObserverList<AnimationPlayer>::Iterator(
+ &element_animations->players_list())
+ .GetNext()
+ : nullptr;
}
AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(
ElementId element_id) {
const scoped_refptr<ElementAnimations> element_animations =
host_impl_->GetElementAnimationsForElementId(element_id);
- return element_animations ? element_animations->players_list().head()->value()
- : nullptr;
+ return element_animations
+ ? base::ObserverList<AnimationPlayer>::Iterator(
+ &element_animations->players_list())
+ .GetNext()
+ : nullptr;
}
int AnimationTimelinesTest::NextTestLayerId() {
« cc/animation/element_animations_unittest.cc ('K') | « 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