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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 for (size_t i = 0; i < decodedFramesCount(); ++i) | 99 for (size_t i = 0; i < decodedFramesCount(); ++i) |
100 size += frameDecodedSize(i); | 100 size += frameDecodedSize(i); |
101 return size; | 101 return size; |
102 } | 102 } |
103 | 103 |
104 void advanceAnimation() | 104 void advanceAnimation() |
105 { | 105 { |
106 m_image->advanceAnimation(0); | 106 m_image->advanceAnimation(0); |
107 } | 107 } |
108 | 108 |
| 109 PassRefPtr<Image> imageForDefaultFrame() |
| 110 { |
| 111 return m_image->imageForDefaultFrame(); |
| 112 } |
| 113 |
109 protected: | 114 protected: |
110 virtual void SetUp() OVERRIDE | 115 virtual void SetUp() OVERRIDE |
111 { | 116 { |
112 DeferredImageDecoder::setEnabled(false); | 117 DeferredImageDecoder::setEnabled(false); |
113 m_image = BitmapImage::create(&m_imageObserver); | 118 m_image = BitmapImage::create(&m_imageObserver); |
114 } | 119 } |
115 | 120 |
116 FakeImageObserver m_imageObserver; | 121 FakeImageObserver m_imageObserver; |
117 RefPtr<BitmapImage> m_image; | 122 RefPtr<BitmapImage> m_image; |
118 }; | 123 }; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 228 |
224 destroyDecodedData(true); | 229 destroyDecodedData(true); |
225 resetDecoder(); | 230 resetDecoder(); |
226 | 231 |
227 loadImage("/LayoutTests/fast/images/resources/test.webp"); | 232 loadImage("/LayoutTests/fast/images/resources/test.webp"); |
228 EXPECT_EQ(1u, decodedFramesCount()); | 233 EXPECT_EQ(1u, decodedFramesCount()); |
229 EXPECT_EQ(65536u, decodedSize()); | 234 EXPECT_EQ(65536u, decodedSize()); |
230 EXPECT_FALSE(m_image->hasColorProfile()); | 235 EXPECT_FALSE(m_image->hasColorProfile()); |
231 } | 236 } |
232 | 237 |
| 238 TEST_F(BitmapImageTest, icoHasWrongFrameDimensions) |
| 239 { |
| 240 loadImage("/LayoutTests/fast/images/resources/wrong-frame-dimensions.ico"); |
| 241 // This call would cause crash without fix for 408026 |
| 242 imageForDefaultFrame(); |
| 243 } |
| 244 |
233 #endif // USE(QCMSLIB) | 245 #endif // USE(QCMSLIB) |
234 | 246 |
235 } // namespace blink | 247 } // namespace blink |
OLD | NEW |