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

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

Issue 1962563002: Fix ImageDecoder::frameIsCompleteAtIndex - fully received instead of decoded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review #23 fix - comments. cleanup. Thanks Leon. Created 4 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/ImageDecoderTestHelpers.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.cpp
index 3c51d4d721e9ce215e416a24110b7697c9c91a37..01d484322822cb2ad66ca4e6f5d44af4264df82d 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTestHelpers.cpp
@@ -86,7 +86,15 @@ void testByteByByteDecode(DecoderCreator createDecoder, const char* file, size_t
if (!decoder->isSizeAvailable())
continue;
+ bool frameIsFullyReceived = decoder->frameIsFullyReceivedAtIndex(frameCount - 1);
ImageFrame* frame = decoder->frameBufferAtIndex(frameCount - 1);
+
+ // FIXME: libwebp parsing of crbug.364830.webp doesn't mark the frame
scroggo_chromium 2016/05/24 19:34:11 We know the file name. Should we special case furt
aleksandar.stojiljkovic 2016/06/06 14:26:38 Written the check differently.
+ // as complete two bytes before the end of the file. However, decoding
+ // it to the same point produces completely decoded frame.
+ if (decoder->filenameExtension() != "webp" || frameIsFullyReceived)
+ EXPECT_EQ(frameIsFullyReceived, decoder->frameIsCompleteAtIndex(frameCount - 1) || decoder->failed());
Peter Kasting 2016/05/25 01:05:23 Isn't this test fundamentally incorrect? It's che
aleksandar.stojiljkovic 2016/05/30 16:12:19 This test checks that frameIsFullyReceivedAtIndex
Peter Kasting 2016/05/31 03:46:42 If you want to check that, isn't the correct test
aleksandar.stojiljkovic 2016/06/01 22:47:35 For other than WebP it is important to check that
aleksandar.stojiljkovic 2016/06/01 22:47:35 Decoder get to know this in setData() which is cal
aleksandar.stojiljkovic 2016/06/06 14:26:38 You have the point here. Written the the check lik
+
if (frame && frame->getStatus() == ImageFrame::FrameComplete && framesDecoded < frameCount)
++framesDecoded;
}

Powered by Google App Engine
This is Rietveld 408576698