#include "components/paint_preview/renderer/paint_preview_recorder_impl.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "components/paint_preview/common/file_stream.h"
#include "components/paint_preview/common/mojom/paint_preview_recorder.mojom.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/test/render_view_test.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_settings.h"
#include "third_party/blink/public/web/web_testing_support.h"
#include "third_party/blink/public/web/web_view.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "ui/native_theme/native_theme_features.h"
namespace paint_preview {
namespace {
constexpr char kCompositeAfterPaint[] = …;
void OnCaptureFinished(mojom::PaintPreviewStatus expected_status,
mojom::PaintPreviewCaptureResponsePtr* out_response,
mojom::PaintPreviewStatus status,
mojom::PaintPreviewCaptureResponsePtr response) { … }
std::string CompositeAfterPaintToString(
const ::testing::TestParamInfo<bool>& cap_enabled) { … }
}
class PaintPreviewRecorderRenderViewTest
: public content::RenderViewTest,
public ::testing::WithParamInterface<bool> { … };
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureMainFrameAndClipping) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureMainFrameWithScroll) { … }
TEST_P(PaintPreviewRecorderRenderViewTest,
TestCaptureMainFrameAboutScrollPosition) { … }
TEST_P(PaintPreviewRecorderRenderViewTest,
TestCaptureMainFrameAboutScrollPositionClampedToEdge) { … }
TEST_P(PaintPreviewRecorderRenderViewTest,
TestCaptureMainFrameIgnoreScrollPosition) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureFragment) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureInvalidFile) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureInvalidXYClip) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureMainFrameAndLocalFrame) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureLocalFrame) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureUnclippedLocalFrame) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureCustomClipRect) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureWithClamp) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, TestCaptureFullIfWidthHeightAre0) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, CaptureWithTranslate) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, CaptureWithTranslateThenRotate) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, CaptureWithRotateThenTranslate) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, CaptureWithScale) { … }
TEST_P(PaintPreviewRecorderRenderViewTest, CaptureSaveRestore) { … }
INSTANTIATE_TEST_SUITE_P(…);
}