OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |