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

Unified Diff: Source/core/animation/PlayerTest.cpp

Issue 185593010: Web Animations: Sort Players in DocumentTimeline::serviceAnimations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « Source/core/animation/Player.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/PlayerTest.cpp
diff --git a/Source/core/animation/PlayerTest.cpp b/Source/core/animation/PlayerTest.cpp
index 7034a8cbccb87a43abcd2ee893d0ea93f0c10bae..36d7e77fec1aace998c1d46a6644939ca036e2af 100644
--- a/Source/core/animation/PlayerTest.cpp
+++ b/Source/core/animation/PlayerTest.cpp
@@ -679,4 +679,29 @@ TEST_F(AnimationPlayerTest, AttachedPlayers)
EXPECT_TRUE(element->activeAnimations()->players().isEmpty());
}
+TEST_F(AnimationPlayerTest, HasLowerPriority)
+{
+ // Note that start time defaults to null
+ RefPtr<Player> player1 = timeline->createPlayer(0);
+ RefPtr<Player> player2 = timeline->createPlayer(0);
+ player2->setStartTime(10);
+ RefPtr<Player> player3 = timeline->createPlayer(0);
+ RefPtr<Player> player4 = timeline->createPlayer(0);
+ player4->setStartTime(20);
+ RefPtr<Player> player5 = timeline->createPlayer(0);
+ player5->setStartTime(10);
+ RefPtr<Player> player6 = timeline->createPlayer(0);
+ player6->setStartTime(-10);
+ Vector<RefPtr<Player> > players;
+ players.append(player1);
+ players.append(player3);
+ players.append(player6);
+ players.append(player2);
+ players.append(player5);
+ players.append(player4);
+ for (int i = 0; i < 6; i++)
Eric Willigers 2014/03/05 06:00:11 players.size()
Timothy Loh 2014/03/05 06:04:08 Done.
+ for (int j = 0; j < 6; j++)
+ EXPECT_EQ(i < j, Player::hasLowerPriority(players[i].get(), players[j].get()));
+}
+
}
« no previous file with comments | « Source/core/animation/Player.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698