| 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 ee469c82bdb6e1ebabc50bae3e7d53a20db3d57a..59f19db4477c71821e7291f81d745416e63f0370 100644
|
| --- a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp
|
| @@ -59,16 +59,11 @@ void TestRepetitionCount(const char* dir,
|
| RefPtr<SharedBuffer> data = ReadFile(dir, file);
|
| ASSERT_TRUE(data.Get());
|
| decoder->SetData(data.Get(), true);
|
| - EXPECT_EQ(kCAnimationLoopOnce,
|
| - decoder->RepetitionCount()); // Default value before decode.
|
|
|
| - for (size_t i = 0; i < decoder->FrameCount(); ++i) {
|
| - ImageFrame* frame = decoder->FrameBufferAtIndex(i);
|
| - EXPECT_EQ(ImageFrame::kFrameComplete, frame->GetStatus());
|
| - }
|
| + // Decode a frame to verify the decoder had a chance to update its state
|
| + decoder->FrameBufferAtIndex(0);
|
|
|
| - EXPECT_EQ(expected_repetition_count,
|
| - decoder->RepetitionCount()); // Expected value after decode.
|
| + EXPECT_EQ(expected_repetition_count, decoder->RepetitionCount());
|
| }
|
|
|
| } // anonymous namespace
|
| @@ -79,7 +74,6 @@ TEST(GIFImageDecoderTest, decodeTwoFrames) {
|
| RefPtr<SharedBuffer> data = ReadFile(kLayoutTestResourcesDir, "animated.gif");
|
| ASSERT_TRUE(data.Get());
|
| decoder->SetData(data.Get(), true);
|
| - EXPECT_EQ(kCAnimationLoopOnce, decoder->RepetitionCount());
|
|
|
| ImageFrame* frame = decoder->FrameBufferAtIndex(0);
|
| uint32_t generation_id0 = frame->Bitmap().getGenerationID();
|
| @@ -104,10 +98,6 @@ TEST(GIFImageDecoderTest, parseAndDecode) {
|
| RefPtr<SharedBuffer> data = ReadFile(kLayoutTestResourcesDir, "animated.gif");
|
| ASSERT_TRUE(data.Get());
|
| decoder->SetData(data.Get(), true);
|
| - EXPECT_EQ(kCAnimationLoopOnce, decoder->RepetitionCount());
|
| -
|
| - // This call will parse the entire file.
|
| - EXPECT_EQ(2u, decoder->FrameCount());
|
|
|
| ImageFrame* frame = decoder->FrameBufferAtIndex(0);
|
| EXPECT_EQ(ImageFrame::kFrameComplete, frame->GetStatus());
|
| @@ -308,24 +298,6 @@ TEST(GIFImageDecoderTest, badCode) {
|
| EXPECT_TRUE(test_decoder->Failed());
|
| }
|
|
|
| -TEST(GIFImageDecoderTest, invalidDisposalMethod) {
|
| - std::unique_ptr<ImageDecoder> decoder = CreateDecoder();
|
| -
|
| - // The image has 2 frames, with disposal method 4 and 5, respectively.
|
| - RefPtr<SharedBuffer> data =
|
| - ReadFile(kDecodersTestingDir, "invalid-disposal-method.gif");
|
| - ASSERT_TRUE(data.Get());
|
| - decoder->SetData(data.Get(), true);
|
| -
|
| - EXPECT_EQ(2u, decoder->FrameCount());
|
| - // Disposal method 4 is converted to ImageFrame::DisposeOverwritePrevious.
|
| - EXPECT_EQ(ImageFrame::kDisposeOverwritePrevious,
|
| - decoder->FrameBufferAtIndex(0)->GetDisposalMethod());
|
| - // Disposal method 5 is ignored.
|
| - EXPECT_EQ(ImageFrame::kDisposeNotSpecified,
|
| - decoder->FrameBufferAtIndex(1)->GetDisposalMethod());
|
| -}
|
| -
|
| TEST(GIFImageDecoderTest, firstFrameHasGreaterSizeThanScreenSize) {
|
| RefPtr<SharedBuffer> full_data = ReadFile(
|
| kDecodersTestingDir, "first-frame-has-greater-size-than-screen-size.gif");
|
|
|