#include "components/paint_preview/browser/paint_preview_base_service.h"
#include <memory>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/paint_preview/browser/paint_preview_base_service_test_factory.h"
#include "components/paint_preview/browser/paint_preview_file_mixin.h"
#include "components/paint_preview/common/mojom/paint_preview_recorder.mojom.h"
#include "components/paint_preview/common/serialized_recording.h"
#include "components/paint_preview/common/test_utils.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_renderer_host.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/lacros/lacros_test_helper.h"
#endif
namespace paint_preview {
namespace {
const char kTestFeatureDir[] = …;
class RejectionPaintPreviewPolicy : public PaintPreviewPolicy { … };
std::unique_ptr<KeyedService> BuildServiceWithRejectionPolicy(
SimpleFactoryKey* key) { … }
base::FilePath CreateDir(scoped_refptr<FileManager> manager,
const DirectoryKey& key) { … }
}
class MockPaintPreviewRecorder : public mojom::PaintPreviewRecorder { … };
class PaintPreviewBaseServiceTest
: public content::RenderViewHostTestHarness,
public testing::WithParamInterface<RecordingPersistence> { … };
TEST_P(PaintPreviewBaseServiceTest, CaptureMainFrame) { … }
TEST_P(PaintPreviewBaseServiceTest, CaptureFailed) { … }
TEST_P(PaintPreviewBaseServiceTest, CaptureDisallowed) { … }
INSTANTIATE_TEST_SUITE_P(…);
}