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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp

Issue 2766263002: Refactor PNGImageDecoder's call to setSize (Closed)
Patch Set: Single return statement Created 3 years, 9 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/png/PNGImageDecoder.h" 5 #include "platform/image-decoders/png/PNGImageDecoder.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "platform/image-decoders/ImageDecoderTestHelpers.h" 8 #include "platform/image-decoders/ImageDecoderTestHelpers.h"
9 #include "png.h" 9 #include "png.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 EXPECT_FALSE(decoder->frameIsCompleteAtIndex(0)); 1036 EXPECT_FALSE(decoder->frameIsCompleteAtIndex(0));
1037 } 1037 }
1038 1038
1039 frame = decoder->frameBufferAtIndex(0); 1039 frame = decoder->frameBufferAtIndex(0);
1040 ASSERT_TRUE(frame); 1040 ASSERT_TRUE(frame);
1041 EXPECT_EQ(ImageFrame::FrameComplete, frame->getStatus()); 1041 EXPECT_EQ(ImageFrame::FrameComplete, frame->getStatus());
1042 EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0)); 1042 EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
1043 } 1043 }
1044 } 1044 }
1045 1045
1046 TEST(PNGTests, sizeMayOverflow) {
1047 auto decoder =
1048 createDecoderWithPngData("/LayoutTests/images/resources/crbug702934.png");
1049 EXPECT_FALSE(decoder->isSizeAvailable());
1050 EXPECT_TRUE(decoder->failed());
1051 }
1052
1046 }; // namespace blink 1053 }; // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698