Index: third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp |
diff --git a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp |
index 88164b1a16260d92e972e6c35d53e2604f24e988..de57fd4d58f515122948bd22398a2057725598e9 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp |
+++ b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp |
@@ -500,4 +500,21 @@ TEST(GIFImageDecoderTest, firstFrameHasGreaterSizeThanScreenSize) |
} |
} |
+TEST(GIFImageDecoderTest, verifyRepetitionCount) |
+{ |
+ const int expectedRepetitionCount = 2; |
+ OwnPtr<ImageDecoder> decoder = createDecoder(); |
+ RefPtr<SharedBuffer> data = readFile(layoutTestResourcesDir, "full2loop.gif"); |
+ ASSERT_TRUE(data.get()); |
+ decoder->setData(data.get(), true); |
+ EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount()); // Default value before decode. |
+ |
+ ImageFrame* frame = decoder->frameBufferAtIndex(0); |
+ EXPECT_EQ(ImageFrame::FrameComplete, frame->getStatus()); |
+ frame = decoder->frameBufferAtIndex(1); |
+ EXPECT_EQ(ImageFrame::FrameComplete, frame->getStatus()); |
+ |
+ EXPECT_EQ(expectedRepetitionCount, decoder->repetitionCount()); // Expected value after decode. |
+} |
+ |
} // namespace blink |