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

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

Issue 2203903002: Color: Read embedded ICC profiles regardless of QCMS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 TEST_F(BitmapImageTest, noColorProfile) 213 TEST_F(BitmapImageTest, noColorProfile)
214 { 214 {
215 loadImage("/LayoutTests/fast/images/resources/green.jpg"); 215 loadImage("/LayoutTests/fast/images/resources/green.jpg");
216 EXPECT_EQ(1u, decodedFramesCount()); 216 EXPECT_EQ(1u, decodedFramesCount());
217 EXPECT_EQ(1024u, decodedSize()); 217 EXPECT_EQ(1024u, decodedSize());
218 EXPECT_FALSE(m_image->hasColorProfile()); 218 EXPECT_FALSE(m_image->hasColorProfile());
219 } 219 }
220 220
221 #if USE(QCMSLIB)
222
223 TEST_F(BitmapImageTest, jpegHasColorProfile) 221 TEST_F(BitmapImageTest, jpegHasColorProfile)
ccameron 2016/08/04 22:07:29 Oh, oops, should have added these tests.
Justin Novosad 2016/08/05 00:06:51 LOL!
224 { 222 {
225 loadImage("/LayoutTests/fast/images/resources/icc-v2-gbr.jpg"); 223 loadImage("/LayoutTests/fast/images/resources/icc-v2-gbr.jpg");
226 EXPECT_EQ(1u, decodedFramesCount()); 224 EXPECT_EQ(1u, decodedFramesCount());
227 EXPECT_EQ(227700u, decodedSize()); 225 EXPECT_EQ(227700u, decodedSize());
228 EXPECT_TRUE(m_image->hasColorProfile()); 226 EXPECT_TRUE(m_image->hasColorProfile());
229 } 227 }
230 228
231 TEST_F(BitmapImageTest, pngHasColorProfile) 229 TEST_F(BitmapImageTest, pngHasColorProfile)
232 { 230 {
233 loadImage("/LayoutTests/fast/images/resources/palatted-color-png-gamma-one-c olor-profile.png"); 231 loadImage("/LayoutTests/fast/images/resources/palatted-color-png-gamma-one-c olor-profile.png");
234 EXPECT_EQ(1u, decodedFramesCount()); 232 EXPECT_EQ(1u, decodedFramesCount());
235 EXPECT_EQ(65536u, decodedSize()); 233 EXPECT_EQ(65536u, decodedSize());
236 EXPECT_TRUE(m_image->hasColorProfile()); 234 EXPECT_TRUE(m_image->hasColorProfile());
237 } 235 }
238 236
239 TEST_F(BitmapImageTest, webpHasColorProfile) 237 TEST_F(BitmapImageTest, webpHasColorProfile)
240 { 238 {
241 loadImage("/LayoutTests/fast/images/resources/webp-color-profile-lossy.webp" ); 239 loadImage("/LayoutTests/fast/images/resources/webp-color-profile-lossy.webp" );
242 EXPECT_EQ(1u, decodedFramesCount()); 240 EXPECT_EQ(1u, decodedFramesCount());
243 EXPECT_EQ(2560000u, decodedSize()); 241 EXPECT_EQ(2560000u, decodedSize());
244 EXPECT_TRUE(m_image->hasColorProfile()); 242 EXPECT_TRUE(m_image->hasColorProfile());
245 } 243 }
246 244
247 #endif // USE(QCMSLIB)
248
249 TEST_F(BitmapImageTest, icoHasWrongFrameDimensions) 245 TEST_F(BitmapImageTest, icoHasWrongFrameDimensions)
250 { 246 {
251 loadImage("/LayoutTests/fast/images/resources/wrong-frame-dimensions.ico"); 247 loadImage("/LayoutTests/fast/images/resources/wrong-frame-dimensions.ico");
252 // This call would cause crash without fix for 408026 248 // This call would cause crash without fix for 408026
253 imageForDefaultFrame(); 249 imageForDefaultFrame();
254 } 250 }
255 251
256 TEST_F(BitmapImageTest, correctDecodedDataSize) 252 TEST_F(BitmapImageTest, correctDecodedDataSize)
257 { 253 {
258 // Requesting any one frame shouldn't result in decoding any other frames. 254 // Requesting any one frame shouldn't result in decoding any other frames.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 {"/LayoutTests/fast/images/resources/exif-orientation-5-lu.jpg", OriginLeftT op}, 327 {"/LayoutTests/fast/images/resources/exif-orientation-5-lu.jpg", OriginLeftT op},
332 {"/LayoutTests/fast/images/resources/exif-orientation-6-ru.jpg", OriginRight Top}, 328 {"/LayoutTests/fast/images/resources/exif-orientation-6-ru.jpg", OriginRight Top},
333 {"/LayoutTests/fast/images/resources/exif-orientation-7-rl.jpg", OriginRight Bottom}, 329 {"/LayoutTests/fast/images/resources/exif-orientation-7-rl.jpg", OriginRight Bottom},
334 {"/LayoutTests/fast/images/resources/exif-orientation-8-llo.jpg", OriginLeft Bottom} 330 {"/LayoutTests/fast/images/resources/exif-orientation-8-llo.jpg", OriginLeft Bottom}
335 }; 331 };
336 332
337 INSTANTIATE_TEST_CASE_P(DecodedImageOrientationHistogramTest, DecodedImageOrient ationHistogramTest, 333 INSTANTIATE_TEST_CASE_P(DecodedImageOrientationHistogramTest, DecodedImageOrient ationHistogramTest,
338 ::testing::ValuesIn(kDecodedImageOrientationHistogramTestParams)); 334 ::testing::ValuesIn(kDecodedImageOrientationHistogramTestParams));
339 335
340 } // namespace blink 336 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698