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

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

Issue 2048003002: Remove DeferredImageDecoder::setEnabled and ImageDecoder::deferredImageDecodingEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 | « no previous file | third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86b0e4dbd400254bdf268f56caf3a6cc5c4594a5..60e9fc9ecc7100329b5e0598683535cfea7ca4f8 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
@@ -66,9 +66,6 @@ public:
int m_lastDecodedSizeChangedDelta;
};
- BitmapImageTest() : BitmapImageTest(false) { }
- BitmapImageTest(bool enableDeferredDecoding) : m_enableDeferredDecoding(enableDeferredDecoding) { }
-
static PassRefPtr<SharedBuffer> readFile(const char* fileName)
{
String filePath = testing::blinkRootDir();
@@ -146,16 +143,12 @@ public:
protected:
void SetUp() override
{
- DeferredImageDecoder::setEnabled(m_enableDeferredDecoding);
m_imageObserver = new FakeImageObserver;
m_image = BitmapImage::create(m_imageObserver.get());
}
Persistent<FakeImageObserver> m_imageObserver;
RefPtr<BitmapImage> m_image;
-
-private:
- bool m_enableDeferredDecoding;
};
TEST_F(BitmapImageTest, destroyDecodedData)
@@ -260,13 +253,11 @@ TEST_F(BitmapImageTest, icoHasWrongFrameDimensions)
TEST_F(BitmapImageTest, correctDecodedDataSize)
{
- // When requesting a frame of a multi-frame GIF causes another frame to be
- // decoded as well, both frames' sizes should be reported by the source and
- // thus included in the decoded size changed notification.
+ // Requesting any one frame shouldn't result in decoding any other frames.
loadImage("/LayoutTests/fast/images/resources/anim_none.gif", false);
frameAtIndex(1);
int frameSize = static_cast<int>(m_image->size().area() * sizeof(ImageFrame::PixelData));
- EXPECT_EQ(frameSize * 2, lastDecodedSizeChange());
chrishtr 2016/06/08 20:02:12 Why did this change?
hajimehoshi 2016/06/09 04:02:38 It's because the original test assumed that Deferr
+ EXPECT_EQ(frameSize, lastDecodedSizeChange());
}
TEST_F(BitmapImageTest, recachingFrameAfterDataChanged)
@@ -285,21 +276,6 @@ TEST_F(BitmapImageTest, recachingFrameAfterDataChanged)
EXPECT_EQ(0, lastDecodedSizeChange());
}
-class BitmapImageDeferredDecodingTest : public BitmapImageTest {
-public:
- BitmapImageDeferredDecodingTest() : BitmapImageTest(true) { }
-};
-
-TEST_F(BitmapImageDeferredDecodingTest, correctDecodedDataSize)
-{
- // When deferred decoding is enabled, requesting any one frame shouldn't
- // result in decoding any other frames.
- loadImage("/LayoutTests/fast/images/resources/anim_none.gif", false);
- frameAtIndex(1);
- int frameSize = static_cast<int>(m_image->size().area() * sizeof(ImageFrame::PixelData));
- EXPECT_EQ(frameSize, lastDecodedSizeChange());
-}
-
template <typename HistogramEnumType>
struct HistogramTestParams {
const char* filename;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698