| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |