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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp

Issue 1769343002: GIF decoding: Add a unit test for repetition count (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_file
Patch Set: decode all frames Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e57cbefb574adb23abdf3fbeca1d152d94112796..92d0d5826a12cbc575a8d55bf56a5feefed3322c 100644
--- a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp
@@ -499,4 +499,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.
+
+ for (size_t i = 0; i < decoder->frameCount(); ++i) {
+ ImageFrame* frame = decoder->frameBufferAtIndex(i);
+ EXPECT_EQ(ImageFrame::FrameComplete, frame->getStatus());
+ }
+
+ EXPECT_EQ(expectedRepetitionCount, decoder->repetitionCount()); // Expected value after decode.
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698