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 24 matching lines...) Expand all Loading... |
35 #include "core/animation/CompositorPendingAnimations.h" | 35 #include "core/animation/CompositorPendingAnimations.h" |
36 #include "core/animation/KeyframeEffect.h" | 36 #include "core/animation/KeyframeEffect.h" |
37 #include "core/animation/KeyframeEffectModel.h" | 37 #include "core/animation/KeyframeEffectModel.h" |
38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
39 #include "core/dom/Element.h" | 39 #include "core/dom/Element.h" |
40 #include "core/dom/QualifiedName.h" | 40 #include "core/dom/QualifiedName.h" |
41 #include "core/testing/DummyPageHolder.h" | 41 #include "core/testing/DummyPageHolder.h" |
42 #include "platform/weborigin/KURL.h" | 42 #include "platform/weborigin/KURL.h" |
43 #include "testing/gmock/include/gmock/gmock.h" | 43 #include "testing/gmock/include/gmock/gmock.h" |
44 #include "testing/gtest/include/gtest/gtest.h" | 44 #include "testing/gtest/include/gtest/gtest.h" |
| 45 #include <memory> |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 class MockPlatformTiming : public AnimationTimeline::PlatformTiming { | 49 class MockPlatformTiming : public AnimationTimeline::PlatformTiming { |
49 public: | 50 public: |
50 | 51 |
51 MOCK_METHOD1(wakeAfter, void(double)); | 52 MOCK_METHOD1(wakeAfter, void(double)); |
52 MOCK_METHOD0(serviceOnNextFrame, void()); | 53 MOCK_METHOD0(serviceOnNextFrame, void()); |
53 | 54 |
54 DEFINE_INLINE_TRACE() | 55 DEFINE_INLINE_TRACE() |
(...skipping 25 matching lines...) Expand all Loading... |
80 } | 81 } |
81 | 82 |
82 void updateClockAndService(double time) | 83 void updateClockAndService(double time) |
83 { | 84 { |
84 document->animationClock().updateTime(time); | 85 document->animationClock().updateTime(time); |
85 document->compositorPendingAnimations().update(false); | 86 document->compositorPendingAnimations().update(false); |
86 timeline->serviceAnimations(TimingUpdateForAnimationFrame); | 87 timeline->serviceAnimations(TimingUpdateForAnimationFrame); |
87 timeline->scheduleNextService(); | 88 timeline->scheduleNextService(); |
88 } | 89 } |
89 | 90 |
90 OwnPtr<DummyPageHolder> pageHolder; | 91 std::unique_ptr<DummyPageHolder> pageHolder; |
91 Persistent<Document> document; | 92 Persistent<Document> document; |
92 Persistent<Element> element; | 93 Persistent<Element> element; |
93 Persistent<AnimationTimeline> timeline; | 94 Persistent<AnimationTimeline> timeline; |
94 Timing timing; | 95 Timing timing; |
95 Persistent<MockPlatformTiming> platformTiming; | 96 Persistent<MockPlatformTiming> platformTiming; |
96 | 97 |
97 void wake() | 98 void wake() |
98 { | 99 { |
99 timeline->wake(); | 100 timeline->wake(); |
100 } | 101 } |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 | 355 |
355 TEST_F(AnimationAnimationTimelineTest, UseAnimationAfterTimelineDeref) | 356 TEST_F(AnimationAnimationTimelineTest, UseAnimationAfterTimelineDeref) |
356 { | 357 { |
357 Animation* animation = timeline->play(0); | 358 Animation* animation = timeline->play(0); |
358 timeline.clear(); | 359 timeline.clear(); |
359 // Test passes if this does not crash. | 360 // Test passes if this does not crash. |
360 animation->setStartTime(0); | 361 animation->setStartTime(0); |
361 } | 362 } |
362 | 363 |
363 } // namespace blink | 364 } // namespace blink |
OLD | NEW |