| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 TestByteByByteSizeAvailable( | 438 TestByteByByteSizeAvailable( |
| 439 &CreateWEBPDecoder, "/LayoutTests/images/resources/webp-animated.webp", | 439 &CreateWEBPDecoder, "/LayoutTests/images/resources/webp-animated.webp", |
| 440 142u, false, kAnimationLoopInfinite); | 440 142u, false, kAnimationLoopInfinite); |
| 441 // FIXME: Add color profile support for animated webp images. | 441 // FIXME: Add color profile support for animated webp images. |
| 442 TestByteByByteSizeAvailable( | 442 TestByteByByteSizeAvailable( |
| 443 &CreateWEBPDecoder, | 443 &CreateWEBPDecoder, |
| 444 "/LayoutTests/images/resources/webp-animated-icc-xmp.webp", 1404u, false, | 444 "/LayoutTests/images/resources/webp-animated-icc-xmp.webp", 1404u, false, |
| 445 32000); | 445 32000); |
| 446 } | 446 } |
| 447 | 447 |
| 448 TEST(AnimatedWEBPTests, clearCacheExceptFrameWithAncestors) { | 448 TEST(AnimatedWebPTests, clearCacheExceptFrameWithAncestors) { |
| 449 std::unique_ptr<ImageDecoder> decoder = CreateWEBPDecoder(); | 449 std::unique_ptr<ImageDecoder> decoder = CreateWEBPDecoder(); |
| 450 | 450 |
| 451 RefPtr<SharedBuffer> full_data = | 451 RefPtr<SharedBuffer> full_data = |
| 452 ReadFile("/LayoutTests/images/resources/webp-animated.webp"); | 452 ReadFile("/LayoutTests/images/resources/webp-animated.webp"); |
| 453 ASSERT_TRUE(full_data.Get()); | 453 ASSERT_TRUE(full_data.Get()); |
| 454 decoder->SetData(full_data.Get(), true); | 454 decoder->SetData(full_data.Get(), true); |
| 455 | 455 |
| 456 ASSERT_EQ(3u, decoder->FrameCount()); | 456 ASSERT_EQ(3u, decoder->FrameCount()); |
| 457 // We need to store pointers to the image frames, since calling | 457 // We need to store pointers to the image frames, since calling |
| 458 // FrameBufferAtIndex will decode the frame if it is not FrameComplete, | 458 // FrameBufferAtIndex will decode the frame if it is not FrameComplete, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 std::unique_ptr<ImageDecoder> decoder = CreateWEBPDecoder(); | 550 std::unique_ptr<ImageDecoder> decoder = CreateWEBPDecoder(); |
| 551 RefPtr<SharedBuffer> data = | 551 RefPtr<SharedBuffer> data = |
| 552 ReadFile("/LayoutTests/images/resources/webp-color-profile-lossy.webp"); | 552 ReadFile("/LayoutTests/images/resources/webp-color-profile-lossy.webp"); |
| 553 ASSERT_TRUE(data.Get()); | 553 ASSERT_TRUE(data.Get()); |
| 554 decoder->SetData(data.Get(), true); | 554 decoder->SetData(data.Get(), true); |
| 555 EXPECT_EQ(1u, decoder->FrameCount()); | 555 EXPECT_EQ(1u, decoder->FrameCount()); |
| 556 EXPECT_EQ(kAnimationNone, decoder->RepetitionCount()); | 556 EXPECT_EQ(kAnimationNone, decoder->RepetitionCount()); |
| 557 } | 557 } |
| 558 | 558 |
| 559 } // namespace blink | 559 } // namespace blink |
| OLD | NEW |