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

Side by Side Diff: tests/BadIcoTest.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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/CachedDecodingPixelRefTest.cpp » ('j') | tests/GifTest.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "Resources.h"
9 #include "Test.h"
10 #include "SkBitmap.h"
11 #include "SkImageDecoder.h"
12 #include "SkOSFile.h"
13
14 DEF_TEST(BadImage, reporter) {
15 const char* const badImages [] = {
16 "sigabort_favicon.ico",
17 "sigsegv_favicon.ico",
18 "sigsegv_favicon_2.ico",
19 "ico_leak01.ico",
20 "ico_fuzz0.ico",
21 "ico_fuzz1.ico",
22 "skbug3442.webp",
23 "skbug3429.webp",
24 };
25
26 const char* badImagesFolder = "invalid_images";
27
28 SkString resourcePath = GetResourcePath(badImagesFolder);
29
30 SkBitmap bm;
31 for (size_t i = 0; i < SK_ARRAY_COUNT(badImages); ++i) {
32 SkString fullPath = SkOSPath::Join(resourcePath.c_str(), badImages[i]);
33 bool success = SkImageDecoder::DecodeFile(fullPath.c_str(), &bm);
scroggo 2016/02/25 12:43:29 Why not switch this to use SkCodec?
msarett 2016/03/01 00:21:11 Done.
34 // These files are invalid, and should not decode. More importantly,
35 // though, we reached here without crashing.
36 REPORTER_ASSERT(reporter, !success);
37 }
38 }
OLDNEW
« no previous file with comments | « no previous file | tests/CachedDecodingPixelRefTest.cpp » ('j') | tests/GifTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698