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

Unified Diff: tests/CodexTest.cpp

Issue 1733863003: Fix bug in SkGifCodec / Switch SkImageDec tests to use Codec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gif bug fix! 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/CodecPriv.h ('k') | tests/FrontBufferedStreamTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CodexTest.cpp
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp
index a0789fb819a71b18ab3a58ffbe6298664aca6eae..307c1ee5744db2f37ed58a205ad8b3e503dd5f72 100644
--- a/tests/CodexTest.cpp
+++ b/tests/CodexTest.cpp
@@ -12,7 +12,6 @@
#include "SkCodecImageGenerator.h"
#include "SkData.h"
#include "SkFrontBufferedStream.h"
-#include "SkImageDecoder.h"
#include "SkMD5.h"
#include "SkRandom.h"
#include "SkStream.h"
@@ -915,10 +914,10 @@ DEF_TEST(Codec_webp_peek, r) {
test_info(r, codec.get(), codec->getInfo(), SkCodec::kSuccess, nullptr);
}
-// SkCodec's wbmp decoder was initially more restrictive than SkImageDecoder.
-// It required the second byte to be zero. But SkImageDecoder allowed a couple
-// of bits to be 1 (so long as they do not overlap with 0x9F). Test that
-// SkCodec now supports an image with these bits set.
+// SkCodec's wbmp decoder was initially unnecessarily restrictive.
+// It required the second byte to be zero. The wbmp specification allows
+// a couple of bits to be 1 (so long as they do not overlap with 0x9F).
+// Test that SkCodec now supports an image with these bits set.
DEF_TEST(Codec_wbmp, r) {
const char* path = "mandrill.wbmp";
SkAutoTDelete<SkStream> stream(resource(path));
@@ -932,11 +931,7 @@ DEF_TEST(Codec_wbmp, r) {
uint8_t* writeableData = static_cast<uint8_t*>(data->writable_data());
writeableData[1] = static_cast<uint8_t>(~0x9F);
- // SkImageDecoder supports this.
- SkBitmap bitmap;
- REPORTER_ASSERT(r, SkImageDecoder::DecodeMemory(data->data(), data->size(), &bitmap));
-
- // So SkCodec should, too.
+ // SkCodec should support this.
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data));
REPORTER_ASSERT(r, codec);
if (!codec) {
« no previous file with comments | « tests/CodecPriv.h ('k') | tests/FrontBufferedStreamTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698