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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 KeyframeEffect* makeAnimation(double duration = 30, double playbackRate = 1) { | 67 KeyframeEffect* makeAnimation(double duration = 30, double playbackRate = 1) { |
68 Timing timing; | 68 Timing timing; |
69 timing.iterationDuration = duration; | 69 timing.iterationDuration = duration; |
70 timing.playbackRate = playbackRate; | 70 timing.playbackRate = playbackRate; |
71 return KeyframeEffect::create(0, nullptr, timing); | 71 return KeyframeEffect::create(0, nullptr, timing); |
72 } | 72 } |
73 | 73 |
74 bool simulateFrame(double time) { | 74 bool simulateFrame(double time) { |
75 document->animationClock().updateTime(time); | 75 document->animationClock().updateTime(time); |
76 document->compositorPendingAnimations().update(false); | 76 document->compositorPendingAnimations().update( |
| 77 Optional<CompositorElementIdSet>(), false); |
77 // The timeline does not know about our animation, so we have to explicitly | 78 // The timeline does not know about our animation, so we have to explicitly |
78 // call update(). | 79 // call update(). |
79 return animation->update(TimingUpdateForAnimationFrame); | 80 return animation->update(TimingUpdateForAnimationFrame); |
80 } | 81 } |
81 | 82 |
82 Persistent<Document> document; | 83 Persistent<Document> document; |
83 Persistent<AnimationTimeline> timeline; | 84 Persistent<AnimationTimeline> timeline; |
84 Persistent<Animation> animation; | 85 Persistent<Animation> animation; |
85 std::unique_ptr<DummyPageHolder> pageHolder; | 86 std::unique_ptr<DummyPageHolder> pageHolder; |
86 }; | 87 }; |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 EXPECT_EQ(Animation::Idle, animation->playStateInternal()); | 777 EXPECT_EQ(Animation::Idle, animation->playStateInternal()); |
777 EXPECT_TRUE(std::isnan(animation->currentTime())); | 778 EXPECT_TRUE(std::isnan(animation->currentTime())); |
778 EXPECT_TRUE(std::isnan(animation->startTime())); | 779 EXPECT_TRUE(std::isnan(animation->startTime())); |
779 animation->pause(); | 780 animation->pause(); |
780 EXPECT_EQ(Animation::Pending, animation->playStateInternal()); | 781 EXPECT_EQ(Animation::Pending, animation->playStateInternal()); |
781 EXPECT_EQ(0, animation->currentTime()); | 782 EXPECT_EQ(0, animation->currentTime()); |
782 EXPECT_TRUE(std::isnan(animation->startTime())); | 783 EXPECT_TRUE(std::isnan(animation->startTime())); |
783 } | 784 } |
784 | 785 |
785 } // namespace blink | 786 } // namespace blink |
OLD | NEW |