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

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp

Issue 2054643003: Remove duplication of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 5 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/graphics/DeferredImageDecoderTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
index 860757042a910114977156c5a2a5cc876d50fdf3..b72b9dfafe2b4d6d11edc1db93f61995f6d4aef3 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
@@ -409,4 +409,14 @@ TEST_F(DeferredImageDecoderTest, respectActualDecoderSizeOnCreate)
EXPECT_EQ(static_cast<size_t>(0), frameBytesCleared);
}
+TEST_F(DeferredImageDecoderTest, data)
+{
+ RefPtr<SharedBuffer> originalData = SharedBuffer::create(m_data->data(), m_data->size());
+ EXPECT_EQ(originalData->size(), m_data->size());
+ m_lazyDecoder->setData(*originalData, false);
+ RefPtr<SharedBuffer> newData = m_lazyDecoder->data();
+ EXPECT_EQ(originalData->size(), newData->size());
+ EXPECT_EQ(0, std::memcmp(originalData->data(), newData->data(), newData->size()));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698