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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp

Issue 2879123003: blink: Fix frame completion querying for static images. (Closed)
Patch Set: test Created 3 years, 7 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/platform/image-decoders/png/PNGImageDecoderTest.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp
index 4bfa9c3dc1b9de4b554f7231800901c6fa1703dd..baf3bd0dd9bc8c8735c836b93185274b5a7393b7 100644
--- a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp
@@ -1026,21 +1026,19 @@ TEST(PNGTests, VerifyFrameCompleteBehavior) {
decoder->SetData(full_data.Get(), true);
// With full data, parsing the size still does not mark a frame as
- // complete.
+ // complete for animated images.
EXPECT_TRUE(decoder->IsSizeAvailable());
- EXPECT_FALSE(decoder->FrameIsCompleteAtIndex(0));
+ if (rec.expected_frame_count > 1)
+ EXPECT_FALSE(decoder->FrameIsCompleteAtIndex(0));
+ else
+ EXPECT_TRUE(decoder->FrameIsCompleteAtIndex(0));
const auto frame_count = decoder->FrameCount();
ASSERT_EQ(rec.expected_frame_count, frame_count);
- if (frame_count > 1u) {
- // After parsing (the full file), all frames are complete.
- for (size_t i = 0; i < frame_count; ++i)
- EXPECT_TRUE(decoder->FrameIsCompleteAtIndex(i));
- } else {
- // A single frame image is not reported complete until decoding.
- EXPECT_FALSE(decoder->FrameIsCompleteAtIndex(0));
- }
+ // After parsing (the full file), all frames are complete.
+ for (size_t i = 0; i < frame_count; ++i)
+ EXPECT_TRUE(decoder->FrameIsCompleteAtIndex(i));
frame = decoder->FrameBufferAtIndex(0);
ASSERT_TRUE(frame);

Powered by Google App Engine
This is Rietveld 408576698