Chromium Code Reviews| Index: tests/ImageDecodingTest.cpp |
| diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp |
| index d070f615b351285ef5d0bdfa0c3adc1abed2d308..d475360dca3a0657fa723587ddead7c2732cef7e 100644 |
| --- a/tests/ImageDecodingTest.cpp |
| +++ b/tests/ImageDecodingTest.cpp |
| @@ -723,3 +723,27 @@ DEF_TEST(ImageDecoderOptions, reporter) { |
| } |
| } |
| } |
| + |
| +DEF_TEST(DiscardablePixelRef_SecondLock, r) { |
|
djsollen
2014/07/28 15:09:41
add color table to the name of the test if that is
|
| + SkString resourceDir = GetResourcePath(); |
| + SkString path = SkOSPath::SkPathJoin(resourceDir.c_str(), "randPixels.gif"); |
| + if (!sk_exists(path.c_str())) { |
| + return; |
| + } |
| + SkAutoDataUnref encoded(SkData::NewFromFileName(path.c_str())); |
| + SkBitmap bitmap; |
| + if (!SkInstallDiscardablePixelRef( |
| + SkDecodingImageGenerator::Create( |
| + encoded, SkDecodingImageGenerator::Options()), &bitmap)) { |
| + ERRORF(r, "SkInstallDiscardablePixelRef [randPixels.gif] failed."); |
| + return; |
| + } |
| + { |
| + SkAutoLockPixels alp(bitmap); |
| + REPORTER_ASSERT(r, bitmap.getColorTable() && "first pass"); |
| + } |
| + { |
| + SkAutoLockPixels alp(bitmap); |
| + REPORTER_ASSERT(r, bitmap.getColorTable() && "second pass"); |
| + } |
| +} |