| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 timeline->serviceAnimations(TimingUpdateForAnimationFrame); | 702 timeline->serviceAnimations(TimingUpdateForAnimationFrame); |
| 703 EXPECT_EQ(1, element->activeAnimations()->players().find(player.get())->valu
e); | 703 EXPECT_EQ(1, element->activeAnimations()->players().find(player.get())->valu
e); |
| 704 | 704 |
| 705 player.release(); | 705 player.release(); |
| 706 Heap::collectAllGarbage(); | 706 Heap::collectAllGarbage(); |
| 707 EXPECT_TRUE(element->activeAnimations()->players().isEmpty()); | 707 EXPECT_TRUE(element->activeAnimations()->players().isEmpty()); |
| 708 } | 708 } |
| 709 | 709 |
| 710 TEST_F(AnimationAnimationPlayerTest, HasLowerPriority) | 710 TEST_F(AnimationAnimationPlayerTest, HasLowerPriority) |
| 711 { | 711 { |
| 712 // Sort time defaults to timeline current time | |
| 713 updateTimeline(15); | |
| 714 RefPtrWillBeRawPtr<AnimationPlayer> player1 = timeline->createAnimationPlaye
r(0); | 712 RefPtrWillBeRawPtr<AnimationPlayer> player1 = timeline->createAnimationPlaye
r(0); |
| 715 RefPtrWillBeRawPtr<AnimationPlayer> player2 = timeline->createAnimationPlaye
r(0); | 713 RefPtrWillBeRawPtr<AnimationPlayer> player2 = timeline->createAnimationPlaye
r(0); |
| 716 player2->setStartTimeInternal(10); | 714 EXPECT_TRUE(AnimationPlayer::hasLowerPriority(player1.get(), player2.get()))
; |
| 717 RefPtrWillBeRawPtr<AnimationPlayer> player3 = timeline->createAnimationPlaye
r(0); | |
| 718 RefPtrWillBeRawPtr<AnimationPlayer> player4 = timeline->createAnimationPlaye
r(0); | |
| 719 player4->setStartTimeInternal(20); | |
| 720 RefPtrWillBeRawPtr<AnimationPlayer> player5 = timeline->createAnimationPlaye
r(0); | |
| 721 player5->setStartTimeInternal(10); | |
| 722 RefPtrWillBeRawPtr<AnimationPlayer> player6 = timeline->createAnimationPlaye
r(0); | |
| 723 player6->setStartTimeInternal(-10); | |
| 724 Vector<RefPtrWillBeMember<AnimationPlayer> > players; | |
| 725 players.append(player6); | |
| 726 players.append(player2); | |
| 727 players.append(player5); | |
| 728 players.append(player1); | |
| 729 players.append(player3); | |
| 730 players.append(player4); | |
| 731 for (size_t i = 0; i < players.size(); i++) { | |
| 732 for (size_t j = 0; j < players.size(); j++) | |
| 733 EXPECT_EQ(i < j, AnimationPlayer::hasLowerPriority(players[i].get(),
players[j].get())); | |
| 734 } | |
| 735 } | 715 } |
| 736 | 716 |
| 737 } | 717 } |
| OLD | NEW |