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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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"
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698