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