#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "net/base/io_buffer.h"
#include "net/base/test_completion_callback.h"
#include "net/filter/filter_source_stream_test_util.h"
#include "net/filter/gzip_source_stream.h"
#include "net/filter/mock_source_stream.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/zlib/zlib.h"
namespace net {
namespace {
const int kBigBufferSize = …;
const int kSmallBufferSize = …;
enum class ReadResultType { … };
const size_t kEOFMargin = …;
struct GzipTestParam { … };
}
class GzipSourceStreamTest : public ::testing::TestWithParam<GzipTestParam> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(GzipSourceStreamTest, EmptyStream) { … }
TEST_P(GzipSourceStreamTest, DeflateOneBlock) { … }
TEST_P(GzipSourceStreamTest, GzipOneBloc) { … }
TEST_P(GzipSourceStreamTest, DeflateTwoReads) { … }
TEST_P(GzipSourceStreamTest, IgnoreDataAfterEof) { … }
TEST_P(GzipSourceStreamTest, MissingZlibHeader) { … }
TEST_P(GzipSourceStreamTest, CorruptGzipHeader) { … }
TEST_P(GzipSourceStreamTest, GzipCorrectness) { … }
TEST_P(GzipSourceStreamTest, GzipCorrectnessWithoutFooter) { … }
TEST_P(GzipSourceStreamTest, DeflateWithAdler32) { … }
TEST_P(GzipSourceStreamTest, DeflateWithBadAdler32) { … }
TEST_P(GzipSourceStreamTest, DeflateWithoutHeaderWithAdler32) { … }
TEST_P(GzipSourceStreamTest, DeflateWithoutHeaderWithBadAdler32) { … }
}