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

Side by Side Diff: Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp

Issue 284043003: Looping of animated WebP: Loop count off-by-one (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha()); 350 EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha());
351 } 351 }
352 352
353 EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount()); 353 EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount());
354 EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount()); 354 EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
355 } 355 }
356 356
357 TEST(AnimatedWebPTests, parseAndDecodeByteByByte) 357 TEST(AnimatedWebPTests, parseAndDecodeByteByByte)
358 { 358 {
359 testByteByByteDecode("/LayoutTests/fast/images/resources/webp-animated.webp" , 3u, cAnimationLoopInfinite); 359 testByteByByteDecode("/LayoutTests/fast/images/resources/webp-animated.webp" , 3u, cAnimationLoopInfinite);
360 testByteByByteDecode("/LayoutTests/fast/images/resources/webp-animated-icc-x mp.webp", 13u, 32000); 360 testByteByByteDecode("/LayoutTests/fast/images/resources/webp-animated-icc-x mp.webp", 13u, 31999);
361 } 361 }
362 362
363 TEST(AnimatedWebPTests, invalidImages) 363 TEST(AnimatedWebPTests, invalidImages)
364 { 364 {
365 // ANMF chunk size is smaller than ANMF header size. 365 // ANMF chunk size is smaller than ANMF header size.
366 testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp.w ebp", true); 366 testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp.w ebp", true);
367 // One of the frame rectangles extends outside the image boundary. 367 // One of the frame rectangles extends outside the image boundary.
368 testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp3. webp", true); 368 testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp3. webp", true);
369 } 369 }
370 370
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 592
593 TEST(StaticWebPTests, notAnimated) 593 TEST(StaticWebPTests, notAnimated)
594 { 594 {
595 OwnPtr<WEBPImageDecoder> decoder = createDecoder(); 595 OwnPtr<WEBPImageDecoder> decoder = createDecoder();
596 RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/web p-color-profile-lossy.webp"); 596 RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/web p-color-profile-lossy.webp");
597 ASSERT_TRUE(data.get()); 597 ASSERT_TRUE(data.get());
598 decoder->setData(data.get(), true); 598 decoder->setData(data.get(), true);
599 EXPECT_EQ(1u, decoder->frameCount()); 599 EXPECT_EQ(1u, decoder->frameCount());
600 EXPECT_EQ(cAnimationNone, decoder->repetitionCount()); 600 EXPECT_EQ(cAnimationNone, decoder->repetitionCount());
601 } 601 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698