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

Side by Side Diff: Source/platform/graphics/DeferredImageDecoderTest.cpp

Issue 205333004: Deferred image decoding to handle broken GIFs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/DeferredImageDecoder.cpp ('k') | no next file » | 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) 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
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
OLDNEW
« no previous file with comments | « Source/platform/graphics/DeferredImageDecoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698