| Index: third_party/WebKit/Source/core/animation/DocumentTimelineTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/animation/animatable/AnimatableNeutralTest.cpp b/third_party/WebKit/Source/core/animation/DocumentTimelineTest.cpp
|
| similarity index 62%
|
| copy from third_party/WebKit/Source/core/animation/animatable/AnimatableNeutralTest.cpp
|
| copy to third_party/WebKit/Source/core/animation/DocumentTimelineTest.cpp
|
| index 8873e3ec1781d0adcc1785ca802ed86f84b3b509..6fbdc6cf0cf5838f9bf747bd7883f08fdb2b5e39 100644
|
| --- a/third_party/WebKit/Source/core/animation/animatable/AnimatableNeutralTest.cpp
|
| +++ b/third_party/WebKit/Source/core/animation/DocumentTimelineTest.cpp
|
| @@ -28,15 +28,47 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#include "core/animation/animatable/AnimatableNeutral.h"
|
| +#include "core/animation/DocumentTimeline.h"
|
|
|
| +#include "core/animation/KeyframeEffect.h"
|
| +#include "core/dom/Document.h"
|
| +#include "core/testing/DummyPageHolder.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include <memory>
|
|
|
| namespace blink {
|
|
|
| -TEST(AnimationAnimatableNeutralTest, Create)
|
| +class AnimationDocumentTimelineTest : public ::testing::Test {
|
| +protected:
|
| + virtual void SetUp()
|
| + {
|
| + pageHolder = DummyPageHolder::create();
|
| + document = &pageHolder->document();
|
| + }
|
| +
|
| + virtual void TearDown()
|
| + {
|
| + document.release();
|
| + ThreadHeap::collectAllGarbage();
|
| + }
|
| +
|
| + std::unique_ptr<DummyPageHolder> pageHolder;
|
| + Persistent<Document> document;
|
| + Persistent<DocumentTimeline> timeline;
|
| + Timing timing;
|
| +};
|
| +
|
| +TEST_F(AnimationDocumentTimelineTest, PlayAfterDocumentDeref)
|
| {
|
| - EXPECT_TRUE(AnimatableValue::neutralValue());
|
| + timing.iterationDuration = 2;
|
| + timing.startDelay = 5;
|
| +
|
| + timeline = &document->timeline();
|
| + document = nullptr;
|
| +
|
| + KeyframeEffect* keyframeEffect = KeyframeEffect::create(0, nullptr, timing);
|
| + // Test passes if this does not crash.
|
| + timeline->play(keyframeEffect);
|
| }
|
|
|
| } // namespace blink
|
|
|