Index: third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp |
index 60e9fc9ecc7100329b5e0598683535cfea7ca4f8..03c19a5e000e5c70ebb22162819ccbbd81b95633 100644 |
--- a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp |
@@ -140,6 +140,9 @@ public: |
return m_imageObserver->m_lastDecodedSizeChangedDelta; |
} |
+ PassRefPtr<SharedBuffer> data() { return m_image->data(); } |
+ SharedBuffer* cachedData() { return m_image->cachedData(); } |
+ |
protected: |
void SetUp() override |
{ |
@@ -216,6 +219,16 @@ TEST_F(BitmapImageTest, noColorProfile) |
EXPECT_FALSE(m_image->hasColorProfile()); |
} |
+TEST_F(BitmapImageTest, noCachedData) |
+{ |
+ loadImage("/LayoutTests/fast/images/resources/green.jpg"); |
+ EXPECT_TRUE(m_image->isAllDataReceived()); |
+ // m_image doesn't have its encoded image data. Instead, its |
+ // DeferredImageDecoder has it and data() returns this. |
+ EXPECT_FALSE(cachedData()); |
+ EXPECT_TRUE(data()); |
+} |
+ |
#if USE(QCMSLIB) |
TEST_F(BitmapImageTest, jpegHasColorProfile) |