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

Unified Diff: Source/platform/image-decoders/ImageDecoderTest.cpp

Issue 136503002: Allow frames to be free'd even for static images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update ImageFrameGeneratorTest.frameHasAlpha unittest. Created 6 years, 11 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: Source/platform/image-decoders/ImageDecoderTest.cpp
diff --git a/Source/platform/image-decoders/ImageDecoderTest.cpp b/Source/platform/image-decoders/ImageDecoderTest.cpp
index 9d4ba3b742ff66f2af84ea671d46183ebb22e146..bd52b1377397a6b3c1bcecd7d30234682fffc5b1 100644
--- a/Source/platform/image-decoders/ImageDecoderTest.cpp
+++ b/Source/platform/image-decoders/ImageDecoderTest.cpp
@@ -228,6 +228,18 @@ TEST(ImageDecoderTest, clearCacheExceptFrameAll)
}
}
+TEST(ImageDecoderTest, clearCacheExceptFrameAllSingleFrame)
+{
+ OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+ decoder->initFrames(1);
+ ImageFrame* frame = &decoder->frameBufferCache().first();
+ frame->setStatus(ImageFrame::FrameComplete);
+
+ decoder->clearCacheExceptFrame(kNotFound);
+
Peter Kasting 2014/01/14 20:04:49 Nit: Extra blank line (line 224 could probably als
fs 2014/01/15 09:48:24 Will prune.
+ EXPECT_EQ(ImageFrame::FrameEmpty, frame->status());
+}
+
TEST(ImageDecoderTest, clearCacheExceptFramePreverveClearExceptFrame)
{
const size_t numFrames = 10;

Powered by Google App Engine
This is Rietveld 408576698