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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoderTest.cpp

Issue 2523943002: Explicitly specify target color space to ImageDecoder at creation (Closed)
Patch Set: Rebase Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/image-decoders/ico/ICOImageDecoder.h" 5 #include "platform/image-decoders/ico/ICOImageDecoder.h"
6 6
7 #include "platform/image-decoders/ImageDecoderTestHelpers.h" 7 #include "platform/image-decoders/ImageDecoderTestHelpers.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "wtf/PtrUtil.h" 9 #include "wtf/PtrUtil.h"
10 #include <memory> 10 #include <memory>
11 11
12 namespace blink { 12 namespace blink {
13 13
14 namespace { 14 namespace {
15 15
16 std::unique_ptr<ImageDecoder> createDecoder() { 16 std::unique_ptr<ImageDecoder> createDecoder() {
17 return wrapUnique(new ICOImageDecoder(ImageDecoder::AlphaNotPremultiplied, 17 return wrapUnique(new ICOImageDecoder(
18 ImageDecoder::ColorSpaceApplied, 18 ImageDecoder::AlphaNotPremultiplied, ImageDecoder::ColorSpaceTransformed,
19 ImageDecoder::noDecodedImageByteLimit)); 19 ImageDecoder::targetColorSpaceForTesting(),
20 ImageDecoder::noDecodedImageByteLimit));
20 } 21 }
21 } 22 }
22 23
23 TEST(ICOImageDecoderTests, parseAndDecodeByteByByte) { 24 TEST(ICOImageDecoderTests, parseAndDecodeByteByByte) {
24 testByteByByteDecode(&createDecoder, 25 testByteByByteDecode(&createDecoder,
25 "/LayoutTests/images/resources/2entries.ico", 2u, 26 "/LayoutTests/images/resources/2entries.ico", 2u,
26 cAnimationNone); 27 cAnimationNone);
27 testByteByByteDecode(&createDecoder, 28 testByteByByteDecode(&createDecoder,
28 "/LayoutTests/images/resources/greenbox-3frames.cur", 3u, 29 "/LayoutTests/images/resources/greenbox-3frames.cur", 3u,
29 cAnimationNone); 30 cAnimationNone);
30 testByteByByteDecode( 31 testByteByByteDecode(
31 &createDecoder, 32 &createDecoder,
32 "/LayoutTests/images/resources/icon-without-and-bitmap.ico", 1u, 33 "/LayoutTests/images/resources/icon-without-and-bitmap.ico", 1u,
33 cAnimationNone); 34 cAnimationNone);
34 testByteByByteDecode(&createDecoder, "/LayoutTests/images/resources/1bit.ico", 35 testByteByByteDecode(&createDecoder, "/LayoutTests/images/resources/1bit.ico",
35 1u, cAnimationNone); 36 1u, cAnimationNone);
36 testByteByByteDecode(&createDecoder, 37 testByteByByteDecode(&createDecoder,
37 "/LayoutTests/images/resources/bug653075.ico", 2u, 38 "/LayoutTests/images/resources/bug653075.ico", 2u,
38 cAnimationNone); 39 cAnimationNone);
39 } 40 }
40 41
41 } // namespace blink 42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698