#include "third_party/blink/renderer/platform/graphics/deferred_image_decoder.h"
#include <memory>
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/graphics/image_decoding_store.h"
#include "third_party/blink/renderer/platform/graphics/image_frame_generator.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_canvas.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_record.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_recorder.h"
#include "third_party/blink/renderer/platform/graphics/test/mock_image_decoder.h"
#include "third_party/blink/renderer/platform/scheduler/public/non_main_thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_skia.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPixmap.h"
#include "third_party/skia/include/core/SkSurface.h"
namespace blink {
namespace {
const unsigned char kWhitePNG[] = …;
const unsigned char kWhiteGIF[] = …;
}
class DeferredImageDecoderTest : public testing::Test,
public MockImageDecoderClient { … };
TEST_F(DeferredImageDecoderTest, drawIntoPaintRecord) { … }
TEST_F(DeferredImageDecoderTest, drawIntoPaintRecordProgressive) { … }
TEST_F(DeferredImageDecoderTest, allDataReceivedPriorToDecodeNonIncrementally) { … }
TEST_F(DeferredImageDecoderTest, allDataReceivedPriorToDecodeIncrementally) { … }
TEST_F(DeferredImageDecoderTest, notAllDataReceivedPriorToDecode) { … }
static void RasterizeMain(cc::PaintCanvas* canvas, PaintRecord record) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_decodeOnOtherThread …
#else
#define MAYBE_decodeOnOtherThread …
#endif
TEST_F(DeferredImageDecoderTest, MAYBE_decodeOnOtherThread) { … }
TEST_F(DeferredImageDecoderTest, singleFrameImageLoading) { … }
TEST_F(DeferredImageDecoderTest, multiFrameImageLoading) { … }
TEST_F(DeferredImageDecoderTest, decodedSize) { … }
TEST_F(DeferredImageDecoderTest, smallerFrameCount) { … }
TEST_F(DeferredImageDecoderTest, frameOpacity) { … }
TEST_F(DeferredImageDecoderTest, data) { … }
class MultiFrameDeferredImageDecoderTest : public DeferredImageDecoderTest { … };
TEST_F(MultiFrameDeferredImageDecoderTest, PaintImage) { … }
TEST_F(MultiFrameDeferredImageDecoderTest, FrameDurationOverride) { … }
}