#include "chrome/browser/extensions/api/image_writer_private/operation.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/api/image_writer_private/error_constants.h"
#include "chrome/browser/extensions/api/image_writer_private/operation_manager.h"
#include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/zlib/google/zip.h"
namespace extensions {
namespace image_writer {
namespace {
_;
AnyNumber;
AtLeast;
Gt;
Lt;
#if !BUILDFLAG(IS_CHROMEOS_ASH)
void SetUpUtilityClientProgressOnVerifyWrite(
const std::vector<int>& progress_list,
bool will_succeed,
FakeImageWriterClient* client) { … }
#endif
}
class OperationForTest : public Operation { … };
class ImageWriterOperationTest : public ImageWriterUnitTestBase { … };
TEST_F(ImageWriterOperationTest, ExtractNonZipFile) { … }
TEST_F(ImageWriterOperationTest, ExtractZipFile) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
TEST_F(ImageWriterOperationTest, WriteImageToDevice) { … }
#endif
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ImageWriterOperationTest, VerifyFileSuccess) { … }
TEST_F(ImageWriterOperationTest, VerifyFileFailure) { … }
#endif
TEST_F(ImageWriterOperationTest, Creation) { … }
}
}