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

Side by Side 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: add some braces Created 6 years, 9 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 | « Source/core/animation/Player.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 Timing timing; 672 Timing timing;
673 RefPtr<Animation> animation = Animation::create(element, nullptr, timing); 673 RefPtr<Animation> animation = Animation::create(element, nullptr, timing);
674 RefPtr<Player> player = timeline->createPlayer(animation.get()); 674 RefPtr<Player> player = timeline->createPlayer(animation.get());
675 timeline->serviceAnimations(); 675 timeline->serviceAnimations();
676 EXPECT_EQ(1U, element->activeAnimations()->players().find(player.get())->val ue); 676 EXPECT_EQ(1U, element->activeAnimations()->players().find(player.get())->val ue);
677 677
678 player.release(); 678 player.release();
679 EXPECT_TRUE(element->activeAnimations()->players().isEmpty()); 679 EXPECT_TRUE(element->activeAnimations()->players().isEmpty());
680 } 680 }
681 681
682 TEST_F(AnimationPlayerTest, HasLowerPriority)
683 {
684 // Note that start time defaults to null
685 RefPtr<Player> player1 = timeline->createPlayer(0);
686 RefPtr<Player> player2 = timeline->createPlayer(0);
687 player2->setStartTime(10);
688 RefPtr<Player> player3 = timeline->createPlayer(0);
689 RefPtr<Player> player4 = timeline->createPlayer(0);
690 player4->setStartTime(20);
691 RefPtr<Player> player5 = timeline->createPlayer(0);
692 player5->setStartTime(10);
693 RefPtr<Player> player6 = timeline->createPlayer(0);
694 player6->setStartTime(-10);
695 Vector<RefPtr<Player> > players;
696 players.append(player1);
697 players.append(player3);
698 players.append(player6);
699 players.append(player2);
700 players.append(player5);
701 players.append(player4);
702 for (size_t i = 0; i < players.size(); i++) {
703 for (size_t j = 0; j < players.size(); j++)
704 EXPECT_EQ(i < j, Player::hasLowerPriority(players[i].get(), players[ j].get()));
705 }
682 } 706 }
707
708 }
OLDNEW
« 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