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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp

Issue 2398453002: Rewrap comments to 80 columns in Source/platform/graphics/. (Closed)
Patch Set: Review feedback Created 4 years, 2 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/graphics/DeferredImageDecoder.h" 5 #include "platform/graphics/DeferredImageDecoder.h"
6 6
7 #include "platform/SharedBuffer.h" 7 #include "platform/SharedBuffer.h"
8 #include "platform/image-decoders/ImageDecoderTestHelpers.h" 8 #include "platform/image-decoders/ImageDecoderTestHelpers.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "third_party/skia/include/core/SkImage.h" 10 #include "third_party/skia/include/core/SkImage.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 EXPECT_EQ(skData->size(), fileBuffer->size()); 96 EXPECT_EQ(skData->size(), fileBuffer->size());
97 const char* data = reinterpret_cast<const char*>(skData->bytes()); 97 const char* data = reinterpret_cast<const char*>(skData->bytes());
98 98
99 // Truncated signature (only 1 byte). Decoder instantiation should fail. 99 // Truncated signature (only 1 byte). Decoder instantiation should fail.
100 RefPtr<SharedBuffer> buffer = SharedBuffer::create<size_t>(data, 1u); 100 RefPtr<SharedBuffer> buffer = SharedBuffer::create<size_t>(data, 1u);
101 EXPECT_FALSE(ImageDecoder::hasSufficientDataToSniffImageType(*buffer)); 101 EXPECT_FALSE(ImageDecoder::hasSufficientDataToSniffImageType(*buffer));
102 EXPECT_EQ(nullptr, DeferredImageDecoder::create( 102 EXPECT_EQ(nullptr, DeferredImageDecoder::create(
103 buffer, false, ImageDecoder::AlphaPremultiplied, 103 buffer, false, ImageDecoder::AlphaPremultiplied,
104 ImageDecoder::GammaAndColorProfileIgnored)); 104 ImageDecoder::GammaAndColorProfileIgnored));
105 105
106 // Append the rest of the data. We should be able to sniff the signature no w, even if segmented. 106 // Append the rest of the data. We should be able to sniff the signature
107 // now, even if segmented.
107 buffer->append<size_t>(data + 1, skData->size() - 1); 108 buffer->append<size_t>(data + 1, skData->size() - 1);
108 EXPECT_TRUE(ImageDecoder::hasSufficientDataToSniffImageType(*buffer)); 109 EXPECT_TRUE(ImageDecoder::hasSufficientDataToSniffImageType(*buffer));
109 std::unique_ptr<DeferredImageDecoder> decoder = 110 std::unique_ptr<DeferredImageDecoder> decoder =
110 DeferredImageDecoder::create(buffer, false, 111 DeferredImageDecoder::create(buffer, false,
111 ImageDecoder::AlphaPremultiplied, 112 ImageDecoder::AlphaPremultiplied,
112 ImageDecoder::GammaAndColorProfileIgnored); 113 ImageDecoder::GammaAndColorProfileIgnored);
113 ASSERT_NE(decoder, nullptr); 114 ASSERT_NE(decoder, nullptr);
114 EXPECT_TRUE(String(testFiles[i]).endsWith(decoder->filenameExtension())); 115 EXPECT_TRUE(String(testFiles[i]).endsWith(decoder->filenameExtension()));
115 } 116 }
116 } 117 }
117 118
118 } // namespace blink 119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698