#include "third_party/zlib/google/zip_reader.h"
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <iterator>
#include <string>
#include <string_view>
#include <vector>
#include "base/check.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/hash/md5.h"
#include "base/i18n/time_formatting.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
#include "third_party/zlib/google/zip_internal.h"
_;
ElementsAre;
ElementsAreArray;
Return;
SizeIs;
namespace {
const static std::string kQuuxExpectedMD5 = …;
class FileWrapper { … };
class MockUnzipListener final { … };
class MockWriterDelegate : public zip::WriterDelegate { … };
bool ExtractCurrentEntryToFilePath(zip::ZipReader* reader,
base::FilePath path) { … }
const zip::ZipReader::Entry* LocateAndOpenEntry(
zip::ZipReader* const reader,
const base::FilePath& path_in_zip) { … }
Paths;
}
namespace zip {
class ZipReaderTest : public PlatformTest { … };
TEST_F(ZipReaderTest, Open_ValidZipFile) { … }
TEST_F(ZipReaderTest, Open_ValidZipPlatformFile) { … }
TEST_F(ZipReaderTest, Open_NonExistentFile) { … }
TEST_F(ZipReaderTest, Open_ExistentButNonZipFile) { … }
TEST_F(ZipReaderTest, Open_EmptyFile) { … }
TEST_F(ZipReaderTest, Iteration) { … }
TEST_F(ZipReaderTest, PlatformFileIteration) { … }
TEST_F(ZipReaderTest, RegularFile) { … }
TEST_F(ZipReaderTest, DotDotFile) { … }
TEST_F(ZipReaderTest, InvalidUTF8File) { … }
TEST_F(ZipReaderTest, EncodingSjisAsUtf8) { … }
TEST_F(ZipReaderTest, EncodingSjisAs1252) { … }
TEST_F(ZipReaderTest, EncodingSjisAsIbm866) { … }
TEST_F(ZipReaderTest, EncodingSjis) { … }
TEST_F(ZipReaderTest, AbsoluteFile) { … }
TEST_F(ZipReaderTest, Directory) { … }
TEST_F(ZipReaderTest, EncryptedFile_WrongPassword) { … }
TEST_F(ZipReaderTest, EncryptedFile_RightPassword) { … }
TEST_F(ZipReaderTest, OpenFromString) { … }
TEST_F(ZipReaderTest, ExtractToFileAsync_RegularFile) { … }
TEST_F(ZipReaderTest, ExtractToFileAsync_Encrypted_NoPassword) { … }
TEST_F(ZipReaderTest, ExtractToFileAsync_Encrypted_RightPassword) { … }
TEST_F(ZipReaderTest, ExtractToFileAsync_WrongCrc) { … }
TEST_F(ZipReaderTest, ExtractToFileAsync_Directory) { … }
TEST_F(ZipReaderTest, ExtractCurrentEntryToString) { … }
TEST_F(ZipReaderTest, ExtractPartOfCurrentEntry) { … }
TEST_F(ZipReaderTest, ExtractPosixPermissions) { … }
TEST_F(ZipReaderTest, DISABLED_LeakDetectionTest) { … }
TEST_F(ZipReaderTest, ExtractCurrentEntryPrepareFailure) { … }
TEST_F(ZipReaderTest, ExtractCurrentEntryWriteBytesFailure) { … }
TEST_F(ZipReaderTest, ExtractCurrentEntrySuccess) { … }
TEST_F(ZipReaderTest, WrongCrc) { … }
class FileWriterDelegateTest : public ::testing::Test { … };
TEST_F(FileWriterDelegateTest, WriteToEnd) { … }
TEST_F(FileWriterDelegateTest, EmptyOnError) { … }
}