| OLD | NEW |
| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 197 } |
| 198 | 198 |
| 199 #if USE(QCMSLIB) | 199 #if USE(QCMSLIB) |
| 200 | 200 |
| 201 TEST_F(BitmapImageTest, jpegHasColorProfile) | 201 TEST_F(BitmapImageTest, jpegHasColorProfile) |
| 202 { | 202 { |
| 203 loadImage("/LayoutTests/fast/images/resources/icc-v2-gbr.jpg"); | 203 loadImage("/LayoutTests/fast/images/resources/icc-v2-gbr.jpg"); |
| 204 EXPECT_EQ(1u, decodedFramesCount()); | 204 EXPECT_EQ(1u, decodedFramesCount()); |
| 205 EXPECT_EQ(227700u, decodedSize()); | 205 EXPECT_EQ(227700u, decodedSize()); |
| 206 EXPECT_TRUE(m_image->hasColorProfile()); | 206 EXPECT_TRUE(m_image->hasColorProfile()); |
| 207 | |
| 208 destroyDecodedData(true); | |
| 209 } | 207 } |
| 210 | 208 |
| 211 TEST_F(BitmapImageTest, pngHasColorProfile) | 209 TEST_F(BitmapImageTest, pngHasColorProfile) |
| 212 { | 210 { |
| 213 loadImage("/LayoutTests/fast/images/resources/palatted-color-png-gamma-one-c
olor-profile.png"); | 211 loadImage("/LayoutTests/fast/images/resources/palatted-color-png-gamma-one-c
olor-profile.png"); |
| 214 EXPECT_EQ(1u, decodedFramesCount()); | 212 EXPECT_EQ(1u, decodedFramesCount()); |
| 215 EXPECT_EQ(65536u, decodedSize()); | 213 EXPECT_EQ(65536u, decodedSize()); |
| 216 EXPECT_TRUE(m_image->hasColorProfile()); | 214 EXPECT_TRUE(m_image->hasColorProfile()); |
| 217 | |
| 218 destroyDecodedData(true); | |
| 219 } | 215 } |
| 220 | 216 |
| 221 TEST_F(BitmapImageTest, webpHasColorProfile) | 217 TEST_F(BitmapImageTest, webpHasColorProfile) |
| 222 { | 218 { |
| 223 loadImage("/LayoutTests/fast/images/resources/webp-color-profile-lossy.webp"
); | 219 loadImage("/LayoutTests/fast/images/resources/webp-color-profile-lossy.webp"
); |
| 224 EXPECT_EQ(1u, decodedFramesCount()); | 220 EXPECT_EQ(1u, decodedFramesCount()); |
| 225 EXPECT_EQ(2560000u, decodedSize()); | 221 EXPECT_EQ(2560000u, decodedSize()); |
| 226 EXPECT_TRUE(m_image->hasColorProfile()); | 222 EXPECT_TRUE(m_image->hasColorProfile()); |
| 227 | |
| 228 destroyDecodedData(true); | |
| 229 } | 223 } |
| 230 | 224 |
| 231 #endif // USE(QCMSLIB) | 225 #endif // USE(QCMSLIB) |
| 232 | 226 |
| 233 TEST_F(BitmapImageTest, icoHasWrongFrameDimensions) | 227 TEST_F(BitmapImageTest, icoHasWrongFrameDimensions) |
| 234 { | 228 { |
| 235 loadImage("/LayoutTests/fast/images/resources/wrong-frame-dimensions.ico"); | 229 loadImage("/LayoutTests/fast/images/resources/wrong-frame-dimensions.ico"); |
| 236 // This call would cause crash without fix for 408026 | 230 // This call would cause crash without fix for 408026 |
| 237 imageForDefaultFrame(); | 231 imageForDefaultFrame(); |
| 238 } | 232 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 frameAtIndex(0); | 265 frameAtIndex(0); |
| 272 | 266 |
| 273 // Trying to destroy all data except an undecoded frame should go ahead and | 267 // Trying to destroy all data except an undecoded frame should go ahead and |
| 274 // destroy all other frames. | 268 // destroy all other frames. |
| 275 setCurrentFrame(2); | 269 setCurrentFrame(2); |
| 276 destroyDecodedData(false); | 270 destroyDecodedData(false); |
| 277 EXPECT_EQ(-frameSize * 2, m_imageObserver.m_lastDecodedSizeChangedDelta); | 271 EXPECT_EQ(-frameSize * 2, m_imageObserver.m_lastDecodedSizeChangedDelta); |
| 278 } | 272 } |
| 279 | 273 |
| 280 } // namespace blink | 274 } // namespace blink |
| OLD | NEW |