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

Side by Side Diff: Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp

Issue 23646005: Improve GIF decoding performance (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bad code initial dictionary Created 7 years, 3 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
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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 EXPECT_EQ(frameCount, decoder->frameCount()); 444 EXPECT_EQ(frameCount, decoder->frameCount());
445 ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1); 445 ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1);
446 EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitma p())); 446 EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitma p()));
447 decoder->clearCacheExceptFrame(notFound); 447 decoder->clearCacheExceptFrame(notFound);
448 448
449 // Resume decoding of the first frame. 449 // Resume decoding of the first frame.
450 ImageFrame* firstFrame = decoder->frameBufferAtIndex(0); 450 ImageFrame* firstFrame = decoder->frameBufferAtIndex(0);
451 EXPECT_EQ(ImageFrame::FrameComplete, firstFrame->status()); 451 EXPECT_EQ(ImageFrame::FrameComplete, firstFrame->status());
452 EXPECT_EQ(baselineHashes[0], hashSkBitmap(firstFrame->getSkBitmap())); 452 EXPECT_EQ(baselineHashes[0], hashSkBitmap(firstFrame->getSkBitmap()));
453 } 453 }
454
455
456 TEST(GIFImageDecoderTest, badInitialCode)
457 {
458 RefPtr<SharedBuffer> testData = readFile("/Source/web/tests/data/bad-initial -code.gif");
Peter Kasting 2013/09/03 18:49:45 Nit: Might want a comment here about what this tes
459 ASSERT_TRUE(testData.get());
460
461 OwnPtr<GIFImageDecoder> testDecoder(createDecoder());
462 testDecoder->setData(testData.get(), true);
463 EXPECT_EQ(1u, testDecoder->frameCount());
464 ASSERT_TRUE(testDecoder->frameBufferAtIndex(0));
465 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698