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