chromium/third_party/blink/renderer/platform/image-decoders/gif/gif_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/gif/gif_image_decoder.h"

#include <memory>
#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 {

const char kWebTestsResourcesDir[] =;

std::unique_ptr<ImageDecoder> CreateDecoder() {}

void TestRepetitionCount(const char* dir,
                         const char* file,
                         int expected_repetition_count) {}

}  // anonymous namespace

TEST(GIFImageDecoderTest, decodeTwoFrames) {}

TEST(GIFImageDecoderTest, crbug779261) {}

TEST(GIFImageDecoderTest, parseAndDecode) {}

TEST(GIFImageDecoderTest, parseByteByByte) {}

TEST(GIFImageDecoderTest, parseAndDecodeByteByByte) {}

TEST(GIFImageDecoderTest, brokenSecondFrame) {}

TEST(GIFImageDecoderTest, progressiveDecode) {}

TEST(GIFImageDecoderTest, allDataReceivedTruncation) {}

TEST(GIFImageDecoderTest, frameIsComplete) {}

TEST(GIFImageDecoderTest, frameIsCompleteLoading) {}

TEST(GIFImageDecoderTest, badTerminator) {}

TEST(GIFImageDecoderTest, updateRequiredPreviousFrameAfterFirstDecode) {}

TEST(GIFImageDecoderTest, randomFrameDecode) {}

TEST(GIFImageDecoderTest, randomDecodeAfterClearFrameBufferCache) {}

// The first LZW codes in the image are invalid values that try to create a loop
// in the dictionary. Decoding should fail, but not infinitely loop or corrupt
// memory.
TEST(GIFImageDecoderTest, badInitialCode) {}

// The image has an invalid LZW code that exceeds dictionary size. Decoding
// should fail.
TEST(GIFImageDecoderTest, badCode) {}

TEST(GIFImageDecoderTest, invalidDisposalMethod) {}

TEST(GIFImageDecoderTest, firstFrameHasGreaterSizeThanScreenSize) {}

TEST(GIFImageDecoderTest, verifyRepetitionCount) {}

TEST(GIFImageDecoderTest, repetitionCountChangesWhenSeen) {}

TEST(GIFImageDecoderTest, bitmapAlphaType) {}

namespace {
// Needed to exercise ImageDecoder::SetMemoryAllocator, but still does the
// default allocation.
class Allocator final : public SkBitmap::Allocator {};
}  // namespace

// Ensure that calling SetMemoryAllocator does not short-circuit
// InitializeNewFrame.
TEST(GIFImageDecoderTest, externalAllocator) {}

TEST(GIFImageDecoderTest, recursiveDecodeFailure) {}

TEST(GIFImageDecoderTest, errorFrame) {}

}  // namespace blink