OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 // The following code should not fail any assert. | 319 // The following code should not fail any assert. |
320 SkCanvas* tempCanvas = m_picture.beginRecording(100, 100); | 320 SkCanvas* tempCanvas = m_picture.beginRecording(100, 100); |
321 tempCanvas->drawBitmap(image->bitmap(), 0, 0); | 321 tempCanvas->drawBitmap(image->bitmap(), 0, 0); |
322 m_picture.endRecording(); | 322 m_picture.endRecording(); |
323 EXPECT_EQ(0, m_frameBufferRequestCount); | 323 EXPECT_EQ(0, m_frameBufferRequestCount); |
324 m_canvas->drawPicture(m_picture); | 324 m_canvas->drawPicture(m_picture); |
325 EXPECT_EQ(1, m_frameBufferRequestCount); | 325 EXPECT_EQ(1, m_frameBufferRequestCount); |
326 } | 326 } |
327 | 327 |
| 328 TEST_F(DeferredImageDecoderTest, smallerFrameCount) |
| 329 { |
| 330 m_frameCount = 1; |
| 331 m_lazyDecoder->setData(m_data.get(), false); |
| 332 EXPECT_EQ(m_frameCount, m_lazyDecoder->frameCount()); |
| 333 m_frameCount = 2; |
| 334 m_lazyDecoder->setData(m_data.get(), false); |
| 335 EXPECT_EQ(m_frameCount, m_lazyDecoder->frameCount()); |
| 336 m_frameCount = 0; |
| 337 m_lazyDecoder->setData(m_data.get(), true); |
| 338 EXPECT_EQ(m_frameCount, m_lazyDecoder->frameCount()); |
| 339 } |
| 340 |
328 } // namespace WebCore | 341 } // namespace WebCore |
OLD | NEW |