Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: third_party/WebKit/Source/core/animation/DocumentTimelineTest.cpp

Issue 2222313002: Implement DocumentTimeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698