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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp

Issue 2523943002: Explicitly specify target color space to ImageDecoder at creation (Closed)
Patch Set: Rebase Created 4 years 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 30 matching lines...) Expand all
41 #include "wtf/dtoa/utils.h" 41 #include "wtf/dtoa/utils.h"
42 #include <memory> 42 #include <memory>
43 43
44 namespace blink { 44 namespace blink {
45 45
46 namespace { 46 namespace {
47 47
48 std::unique_ptr<ImageDecoder> createDecoder( 48 std::unique_ptr<ImageDecoder> createDecoder(
49 ImageDecoder::AlphaOption alphaOption) { 49 ImageDecoder::AlphaOption alphaOption) {
50 return wrapUnique( 50 return wrapUnique(
51 new WEBPImageDecoder(alphaOption, ImageDecoder::ColorSpaceApplied, 51 new WEBPImageDecoder(alphaOption, ImageDecoder::ColorSpaceTransformed,
52 ImageDecoder::targetColorSpaceForTesting(),
52 ImageDecoder::noDecodedImageByteLimit)); 53 ImageDecoder::noDecodedImageByteLimit));
53 } 54 }
54 55
55 std::unique_ptr<ImageDecoder> createDecoder() { 56 std::unique_ptr<ImageDecoder> createDecoder() {
56 return createDecoder(ImageDecoder::AlphaNotPremultiplied); 57 return createDecoder(ImageDecoder::AlphaNotPremultiplied);
57 } 58 }
58 59
59 // If 'parseErrorExpected' is true, error is expected during parse (frameCount() 60 // If 'parseErrorExpected' is true, error is expected during parse (frameCount()
60 // call); else error is expected during decode (frameBufferAtIndex() call). 61 // call); else error is expected during decode (frameBufferAtIndex() call).
61 void testInvalidImage(const char* webpFile, bool parseErrorExpected) { 62 void testInvalidImage(const char* webpFile, bool parseErrorExpected) {
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 std::unique_ptr<ImageDecoder> decoder = createDecoder(); 652 std::unique_ptr<ImageDecoder> decoder = createDecoder();
652 RefPtr<SharedBuffer> data = 653 RefPtr<SharedBuffer> data =
653 readFile("/LayoutTests/images/resources/webp-color-profile-lossy.webp"); 654 readFile("/LayoutTests/images/resources/webp-color-profile-lossy.webp");
654 ASSERT_TRUE(data.get()); 655 ASSERT_TRUE(data.get());
655 decoder->setData(data.get(), true); 656 decoder->setData(data.get(), true);
656 EXPECT_EQ(1u, decoder->frameCount()); 657 EXPECT_EQ(1u, decoder->frameCount());
657 EXPECT_EQ(cAnimationNone, decoder->repetitionCount()); 658 EXPECT_EQ(cAnimationNone, decoder->repetitionCount());
658 } 659 }
659 660
660 } // namespace blink 661 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698