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

Side by Side Diff: Source/core/animation/AnimationPlayerTest.cpp

Issue 210703002: Web Animations: Sort Animations in the AnimationStack (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix compile? :| 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/AnimationPlayer.cpp ('k') | Source/core/animation/AnimationStack.h » ('j') | 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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 RefPtr<AnimationPlayer> player = timeline->createAnimationPlayer(animation.g et()); 687 RefPtr<AnimationPlayer> player = timeline->createAnimationPlayer(animation.g et());
688 timeline->serviceAnimations(); 688 timeline->serviceAnimations();
689 EXPECT_EQ(1U, element->activeAnimations()->players().find(player.get())->val ue); 689 EXPECT_EQ(1U, element->activeAnimations()->players().find(player.get())->val ue);
690 690
691 player.release(); 691 player.release();
692 EXPECT_TRUE(element->activeAnimations()->players().isEmpty()); 692 EXPECT_TRUE(element->activeAnimations()->players().isEmpty());
693 } 693 }
694 694
695 TEST_F(AnimationAnimationPlayerTest, HasLowerPriority) 695 TEST_F(AnimationAnimationPlayerTest, HasLowerPriority)
696 { 696 {
697 // Note that start time defaults to null 697 // Sort time defaults to timeline current time
698 updateTimeline(15);
698 RefPtr<AnimationPlayer> player1 = timeline->createAnimationPlayer(0); 699 RefPtr<AnimationPlayer> player1 = timeline->createAnimationPlayer(0);
699 RefPtr<AnimationPlayer> player2 = timeline->createAnimationPlayer(0); 700 RefPtr<AnimationPlayer> player2 = timeline->createAnimationPlayer(0);
700 player2->setStartTime(10); 701 player2->setStartTime(10);
701 RefPtr<AnimationPlayer> player3 = timeline->createAnimationPlayer(0); 702 RefPtr<AnimationPlayer> player3 = timeline->createAnimationPlayer(0);
702 RefPtr<AnimationPlayer> player4 = timeline->createAnimationPlayer(0); 703 RefPtr<AnimationPlayer> player4 = timeline->createAnimationPlayer(0);
703 player4->setStartTime(20); 704 player4->setStartTime(20);
704 RefPtr<AnimationPlayer> player5 = timeline->createAnimationPlayer(0); 705 RefPtr<AnimationPlayer> player5 = timeline->createAnimationPlayer(0);
705 player5->setStartTime(10); 706 player5->setStartTime(10);
706 RefPtr<AnimationPlayer> player6 = timeline->createAnimationPlayer(0); 707 RefPtr<AnimationPlayer> player6 = timeline->createAnimationPlayer(0);
707 player6->setStartTime(-10); 708 player6->setStartTime(-10);
708 Vector<RefPtr<AnimationPlayer> > players; 709 Vector<RefPtr<AnimationPlayer> > players;
709 players.append(player1);
710 players.append(player3);
711 players.append(player6); 710 players.append(player6);
712 players.append(player2); 711 players.append(player2);
713 players.append(player5); 712 players.append(player5);
713 players.append(player1);
714 players.append(player3);
714 players.append(player4); 715 players.append(player4);
715 for (size_t i = 0; i < players.size(); i++) { 716 for (size_t i = 0; i < players.size(); i++) {
716 for (size_t j = 0; j < players.size(); j++) 717 for (size_t j = 0; j < players.size(); j++)
717 EXPECT_EQ(i < j, AnimationPlayer::hasLowerPriority(players[i].get(), players[j].get())); 718 EXPECT_EQ(i < j, AnimationPlayer::hasLowerPriority(players[i].get(), players[j].get()));
718 } 719 }
719 } 720 }
720 721
721 } 722 }
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationPlayer.cpp ('k') | Source/core/animation/AnimationStack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698