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

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: Prune excess h-space. 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
« no previous file with comments | « Source/platform/image-decoders/ImageDecoder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5647e94e64611ea73aa997cc32d3ce5560376688 100644
--- a/Source/platform/image-decoders/ImageDecoderTest.cpp
+++ b/Source/platform/image-decoders/ImageDecoderTest.cpp
@@ -221,13 +221,23 @@ TEST(ImageDecoderTest, clearCacheExceptFrameAll)
frameBuffers[i].setStatus(i % 2 ? ImageFrame::FramePartial : ImageFrame::FrameComplete);
decoder->clearCacheExceptFrame(kNotFound);
-
for (size_t i = 0; i < numFrames; ++i) {
SCOPED_TRACE(testing::Message() << i);
EXPECT_EQ(ImageFrame::FrameEmpty, frameBuffers[i].status());
}
}
+TEST(ImageDecoderTest, clearCacheExceptFrameAllSingleFrame)
+{
+ OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+ decoder->initFrames(1);
+ ImageFrame* frame = &decoder->frameBufferCache().first();
+ frame->setStatus(ImageFrame::FrameComplete);
+
+ decoder->clearCacheExceptFrame(kNotFound);
+ EXPECT_EQ(ImageFrame::FrameEmpty, frame->status());
+}
+
TEST(ImageDecoderTest, clearCacheExceptFramePreverveClearExceptFrame)
{
const size_t numFrames = 10;
« no previous file with comments | « Source/platform/image-decoders/ImageDecoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698