aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GifTest.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-12-08 11:38:47 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-08 19:30:48 +0000
commit5093a539def3ae09df324018f2343827009b2e05 (patch)
tree0809099fad806dd9a8f00fe0e2dfcd8a958915af /tests/GifTest.cpp
parent0b1b9c233a338ef26e7593c1423795c8ced53e1d (diff)
resources: remove most uses of GetResourcePath()
Going forward, we will standardize on GetResourceAsData(), which will make it easier to run tests in environments without access to the filesystem. Also: GetResourceAsData() complains when a resource is missing. This is usually an error. Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188 Reviewed-on: https://skia-review.googlesource.com/82642 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests/GifTest.cpp')
-rw-r--r--tests/GifTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/GifTest.cpp b/tests/GifTest.cpp
index 5219825f1b..0de5fc586d 100644
--- a/tests/GifTest.cpp
+++ b/tests/GifTest.cpp
@@ -225,12 +225,12 @@ DEF_TEST(Gif, reporter) {
// Regression test for decoding a gif image with sampleSize of 4, which was
// previously crashing.
DEF_TEST(Gif_Sampled, r) {
- auto stream = SkFILEStream::Make(GetResourcePath("images/test640x479.gif").c_str());
- REPORTER_ASSERT(r, stream);
- if (!stream) {
+ auto data = GetResourceAsData("images/test640x479.gif");
+ REPORTER_ASSERT(r, data);
+ if (!data) {
return;
}
-
+ std::unique_ptr<SkStreamAsset> stream(new SkMemoryStream(std::move(data)));
std::unique_ptr<SkAndroidCodec> codec(SkAndroidCodec::MakeFromStream(std::move(stream)));
REPORTER_ASSERT(r, codec);
if (!codec) {