OLD | NEW |
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" |
| 10 #include <memory> |
9 | 11 |
10 namespace blink { | 12 namespace blink { |
11 | 13 |
12 namespace { | 14 namespace { |
13 | 15 |
14 PassOwnPtr<ImageDecoder> createDecoder() | 16 std::unique_ptr<ImageDecoder> createDecoder() |
15 { | 17 { |
16 return adoptPtr(new ICOImageDecoder(ImageDecoder::AlphaNotPremultiplied, Ima
geDecoder::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit)); | 18 return wrapUnique(new ICOImageDecoder(ImageDecoder::AlphaNotPremultiplied, I
mageDecoder::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit)
); |
17 } | 19 } |
18 | 20 |
19 } | 21 } |
20 | 22 |
21 TEST(ICOImageDecoderTests, parseAndDecodeByteByByte) | 23 TEST(ICOImageDecoderTests, parseAndDecodeByteByByte) |
22 { | 24 { |
23 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/2en
tries.ico", 2u, cAnimationNone); | 25 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/2en
tries.ico", 2u, cAnimationNone); |
24 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/gre
enbox-3frames.cur", 3u, cAnimationNone); | 26 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/gre
enbox-3frames.cur", 3u, cAnimationNone); |
25 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/ico
n-without-and-bitmap.ico", 1u, cAnimationNone); | 27 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/ico
n-without-and-bitmap.ico", 1u, cAnimationNone); |
26 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/1bi
t.ico", 1u, cAnimationNone); | 28 testByteByByteDecode(&createDecoder, "/LayoutTests/fast/images/resources/1bi
t.ico", 1u, cAnimationNone); |
27 } | 29 } |
28 | 30 |
29 } // namespace blink | 31 } // namespace blink |
OLD | NEW |