chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder_test.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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() {}

// If 'parse_error_expected' is true, error is expected during parse
// (FrameCount() call); else error is expected during decode
// (FrameBufferAtIndex() call).
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) {}

}  // anonymous namespace

TEST(AnimatedWebPTests, uniqueGenerationIDs) {}

TEST(AnimatedWebPTests, verifyAnimationParametersTransparentImage) {}

TEST(AnimatedWebPTests,
     verifyAnimationParametersOpaqueFramesTransparentBackground) {}

TEST(AnimatedWebPTests, verifyAnimationParametersBlendOverwrite) {}

TEST(AnimatedWebPTests, parseAndDecodeByteByByte) {}

TEST(AnimatedWebPTests, invalidImages) {}

TEST(AnimatedWebPTests, truncatedLastFrame) {}

TEST(AnimatedWebPTests, truncatedInBetweenFrame) {}

// Tests for a crash that used to happen for a specific file with specific
// sequence of method calls.
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) {}

// Regression test for a bug where some valid images were failing to decode
// incrementally.
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) {}

// Although parsing of the image succeeds, decoding of the image fails, so the
// test should not emit to any bpp histogram.
TEST(StaticWebPTests, bppHistogramInvalid) {}

TEST(StaticWebPTests, bppHistogramLossless) {}

TEST(StaticWebPTests, bppHistogramAlpha) {}

TEST(StaticWebPTests, bppHistogramAnimated) {}

}  // namespace blink