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

Unified Diff: cc/animation/element_animations_unittest.cc

Issue 2340923003: CC Animation: Rework iterations over players to use the range-based for loop. (Closed)
Patch Set: Rebase. Created 4 years, 2 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
« no previous file with comments | « cc/animation/element_animations.cc ('k') | cc/test/animation_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/element_animations_unittest.cc
diff --git a/cc/animation/element_animations_unittest.cc b/cc/animation/element_animations_unittest.cc
index 012743a4beb4aaf0e3abe9637f2651ea51ef89de..dedfddb4866b145961f123963211170691e2f00a 100644
--- a/cc/animation/element_animations_unittest.cc
+++ b/cc/animation/element_animations_unittest.cc
@@ -175,11 +175,8 @@ TEST_F(ElementAnimationsTest, AddRemovePlayers) {
EXPECT_TRUE(element_animations_impl);
int list_size_before = 0;
- ElementAnimations::PlayersList::Iterator it(
- &element_animations_impl_->players_list());
- AnimationPlayer* player;
- while ((player = it.GetNext()) != nullptr) {
- EXPECT_TRUE(timeline_->GetPlayerById(player->id()));
+ for (auto& player : element_animations_impl_->players_list()) {
+ EXPECT_TRUE(timeline_->GetPlayerById(player.id()));
++list_size_before;
}
EXPECT_EQ(3, list_size_before);
@@ -193,10 +190,8 @@ TEST_F(ElementAnimationsTest, AddRemovePlayers) {
EXPECT_EQ(element_animations_impl, player_impl_->element_animations());
int list_size_after = 0;
- it = ElementAnimations::PlayersList::Iterator(
- &element_animations_impl_->players_list());
- while ((player = it.GetNext()) != nullptr) {
- EXPECT_TRUE(timeline_->GetPlayerById(player->id()));
+ for (auto& player : element_animations_impl_->players_list()) {
+ EXPECT_TRUE(timeline_->GetPlayerById(player.id()));
++list_size_after;
}
EXPECT_EQ(2, list_size_after);
« no previous file with comments | « cc/animation/element_animations.cc ('k') | cc/test/animation_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698