#include "extensions/browser/image_sanitizer.h"
#include <map>
#include <memory>
#include "base/base64.h"
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
namespace {
constexpr char kBase64edValidPng[] = …;
constexpr char kBase64edInvalidPng[] = …;
class TestClient : public ImageSanitizer::Client { … };
class ImageSanitizerTest : public testing::Test { … };
}
TEST_F(ImageSanitizerTest, NoImagesProvided) { … }
TEST_F(ImageSanitizerTest, InvalidPathAbsolute) { … }
TEST_F(ImageSanitizerTest, InvalidPathReferenceParent) { … }
TEST_F(ImageSanitizerTest, ValidCase) { … }
TEST_F(ImageSanitizerTest, MissingImage) { … }
TEST_F(ImageSanitizerTest, InvalidImage) { … }
TEST_F(ImageSanitizerTest, NoCallbackAfterDelete) { … }
TEST_F(ImageSanitizerTest, DontHoldOnToCallbacksOnFailure) { … }
TEST_F(ImageSanitizerTest, DontHoldOnToCallbacksOnSuccess) { … }
TEST_F(ImageSanitizerTest, DataDecoderServiceCrashes) { … }
}