#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.h"
#include <memory>
#include "base/metrics/histogram_base.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/renderer/platform/image-decoders/image_decoder_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
namespace {
struct AnimParam { … };
std::unique_ptr<ImageDecoder> CreateWEBPDecoder(
ImageDecoder::AlphaOption alpha_option) { … }
std::unique_ptr<ImageDecoder> CreateWEBPDecoder() { … }
void TestInvalidImage(const char* webp_file, bool parse_error_expected) { … }
void TestWebPBppHistogram(const char* image_name,
const char* histogram_name = nullptr,
base::HistogramBase::Sample sample = 0) { … }
}
TEST(AnimatedWebPTests, uniqueGenerationIDs) { … }
TEST(AnimatedWebPTests, verifyAnimationParametersTransparentImage) { … }
TEST(AnimatedWebPTests,
verifyAnimationParametersOpaqueFramesTransparentBackground) { … }
TEST(AnimatedWebPTests, verifyAnimationParametersBlendOverwrite) { … }
TEST(AnimatedWebPTests, parseAndDecodeByteByByte) { … }
TEST(AnimatedWebPTests, invalidImages) { … }
TEST(AnimatedWebPTests, truncatedLastFrame) { … }
TEST(AnimatedWebPTests, truncatedInBetweenFrame) { … }
TEST(AnimatedWebPTests, reproCrash) { … }
TEST(AnimatedWebPTests, progressiveDecode) { … }
TEST(AnimatedWebPTests, frameIsCompleteAndDuration) { … }
TEST(AnimatedWebPTests, updateRequiredPreviousFrameAfterFirstDecode) { … }
TEST(AnimatedWebPTests, randomFrameDecode) { … }
TEST(AnimatedWebPTests, randomDecodeAfterClearFrameBufferCache) { … }
TEST(AnimatedWebPTests, decodeAfterReallocatingData) { … }
TEST(AnimatedWebPTests, alphaBlending) { … }
TEST(AnimatedWebPTests, isSizeAvailable) { … }
TEST(AnimatedWEBPTests, clearCacheExceptFrameWithAncestors) { … }
TEST(StaticWebPTests, truncatedImage) { … }
TEST(StaticWebPTests, incrementalDecode) { … }
TEST(StaticWebPTests, isSizeAvailable) { … }
TEST(StaticWebPTests, notAnimated) { … }
TEST(StaticWebPTests, bppHistogramSmall) { … }
TEST(StaticWebPTests, bppHistogramSmall3x3) { … }
TEST(StaticWebPTests, bppHistogramSmall900000) { … }
TEST(StaticWebPTests, bppHistogramBig) { … }
TEST(StaticWebPTests, bppHistogramBig13000000) { … }
TEST(StaticWebPTests, bppHistogramHuge) { … }
TEST(StaticWebPTests, bppHistogramHuge13000002) { … }
TEST(StaticWebPTests, bppHistogramInvalid) { … }
TEST(StaticWebPTests, bppHistogramLossless) { … }
TEST(StaticWebPTests, bppHistogramAlpha) { … }
TEST(StaticWebPTests, bppHistogramAnimated) { … }
}