#include "components/paint_preview/renderer/paint_preview_recorder_utils.h"
#include <memory>
#include <optional>
#include <string>
#include "base/containers/flat_map.h"
#include "base/containers/flat_set.h"
#include "base/files/file.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/discardable_memory_allocator.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/notreached.h"
#include "base/test/task_environment.h"
#include "base/test/test_discardable_memory_allocator.h"
#include "base/unguessable_token.h"
#include "cc/paint/paint_canvas.h"
#include "cc/paint/paint_flags.h"
#include "cc/paint/paint_image.h"
#include "cc/paint/paint_image_builder.h"
#include "cc/paint/paint_recorder.h"
#include "cc/paint/paint_worklet_input.h"
#include "components/paint_preview/common/file_stream.h"
#include "components/paint_preview/common/mojom/paint_preview_recorder.mojom-shared.h"
#include "components/paint_preview/common/paint_preview_tracker.h"
#include "components/paint_preview/common/serialized_recording.h"
#include "components/paint_preview/common/test_utils.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "skia/ext/font_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/codec/SkCodec.h"
#include "third_party/skia/include/codec/SkPngDecoder.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkBlendMode.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkFont.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkM44.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkSamplingOptions.h"
#include "third_party/skia/include/core/SkTextBlob.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "third_party/skia/include/encode/SkPngEncoder.h"
namespace paint_preview {
namespace {
cc::PaintRecord AddLink(const std::string& link, const SkRect& rect) { … }
}
TEST(PaintPreviewRecorderUtilsTest, TestParseGlyphs) { … }
TEST(PaintPreviewRecorderUtilsTest, TestParseLinks) { … }
TEST(PaintPreviewRecorderUtilsTest, TestTransformSubframeRects) { … }
class PaintPreviewRecorderUtilsSerializeAsSkPictureTest
: public testing::TestWithParam<RecordingPersistence> { … };
TEST_P(PaintPreviewRecorderUtilsSerializeAsSkPictureTest, Roundtrip) { … }
TEST_P(PaintPreviewRecorderUtilsSerializeAsSkPictureTest, RoundtripWithImage) { … }
class FakeTextureBacking : public cc::TextureBacking { … };
TEST_P(PaintPreviewRecorderUtilsSerializeAsSkPictureTest,
RoundtripWithTexture) { … }
TEST_P(PaintPreviewRecorderUtilsSerializeAsSkPictureTest,
RoundtripWithLazyTexture) { … }
TEST_P(PaintPreviewRecorderUtilsSerializeAsSkPictureTest,
RoundtripWithLazyImage) { … }
class TestPaintWorkletInput : public cc::PaintWorkletInput { … };
TEST_P(PaintPreviewRecorderUtilsSerializeAsSkPictureTest,
RoundtripWithPaintWorklet) { … }
TEST_P(PaintPreviewRecorderUtilsSerializeAsSkPictureTest, FailIfExceedMaxSize) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST(PaintPreviewRecorderUtilsTest, TestBuildResponse) { … }
}