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

Unified Diff: tests/FrontBufferedStreamTest.cpp

Issue 1757333002: Fix bug in SkGifCodec / Switch SkImageDec tests to use Codec (Closed) Base URL: https://skia.googlesource.com/skia.git@m50
Patch Set: Created 4 years, 10 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 | « tests/CodexTest.cpp ('k') | tests/GifTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FrontBufferedStreamTest.cpp
diff --git a/tests/FrontBufferedStreamTest.cpp b/tests/FrontBufferedStreamTest.cpp
index 7821c5e40dcfb163ac213710631e8c71d6bf1a31..e3df466fd309b0f2c98eabda0be634b1b50473bd 100644
--- a/tests/FrontBufferedStreamTest.cpp
+++ b/tests/FrontBufferedStreamTest.cpp
@@ -6,8 +6,8 @@
*/
#include "SkBitmap.h"
+#include "SkCodec.h"
#include "SkFrontBufferedStream.h"
-#include "SkImageDecoder.h"
#include "SkRefCnt.h"
#include "SkStream.h"
#include "SkTypes.h"
@@ -289,11 +289,9 @@ private:
DEF_TEST(ShortFrontBufferedStream, reporter) {
FailingStream* failingStream = new FailingStream;
SkAutoTDelete<SkStreamRewindable> stream(SkFrontBufferedStream::Create(failingStream, 64));
- SkBitmap bm;
- // The return value of DecodeStream is not important. We are just using DecodeStream because
- // it simulates a bug. DecodeStream will read the stream, then rewind, then attempt to read
- // again. FrontBufferedStream::read should not continue to read its underlying stream beyond
- // its end.
- SkImageDecoder::DecodeStream(stream, &bm);
+
+ // This will fail to create a codec. However, what we really want to test is that we
+ // won't read past the end of the stream.
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.detach()));
REPORTER_ASSERT(reporter, !failingStream->readAfterEnd());
}
« no previous file with comments | « tests/CodexTest.cpp ('k') | tests/GifTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698