#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/http/http_chunked_decoder.h"
#include <memory>
#include <string>
#include <vector>
#include "base/format_macros.h"
#include "base/strings/stringprintf.h"
#include "net/base/net_errors.h"
#include "net/test/gtest_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
IsError;
IsOk;
namespace net {
namespace {
HttpChunkedDecoderTest;
void RunTest(const char* const inputs[],
size_t num_inputs,
const char* expected_output,
bool expected_eof,
int bytes_after_eof) { … }
void RunTestUntilFailure(const char* const inputs[],
size_t num_inputs,
size_t fail_index) { … }
TEST(HttpChunkedDecoderTest, Basic) { … }
TEST(HttpChunkedDecoderTest, OneChunk) { … }
TEST(HttpChunkedDecoderTest, Typical) { … }
TEST(HttpChunkedDecoderTest, Incremental) { … }
TEST(HttpChunkedDecoderTest, Incremental2) { … }
TEST(HttpChunkedDecoderTest, LF_InsteadOf_CRLF) { … }
TEST(HttpChunkedDecoderTest, Extensions) { … }
TEST(HttpChunkedDecoderTest, Trailers) { … }
TEST(HttpChunkedDecoderTest, TrailersUnfinished) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_TooBig) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_0X) { … }
TEST(HttpChunkedDecoderTest, ChunkSize_TrailingSpace) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_TrailingTab) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_TrailingFormFeed) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_TrailingVerticalTab) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_TrailingNonHexDigit) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_LeadingSpace) { … }
TEST(HttpChunkedDecoderTest, InvalidLeadingSeparator) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_NoSeparator) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_Negative) { … }
TEST(HttpChunkedDecoderTest, InvalidChunkSize_Plus) { … }
TEST(HttpChunkedDecoderTest, InvalidConsecutiveCRLFs) { … }
TEST(HttpChunkedDecoderTest, ReallyBigChunks) { … }
TEST(HttpChunkedDecoderTest, ExcessiveChunkLen) { … }
TEST(HttpChunkedDecoderTest, ExcessiveChunkLen2) { … }
TEST(HttpChunkedDecoderTest, BasicExtraData) { … }
TEST(HttpChunkedDecoderTest, IncrementalExtraData) { … }
TEST(HttpChunkedDecoderTest, MultipleExtraDataBlocks) { … }
TEST(HttpChunkedDecoderTest, LongChunkLengthLine) { … }
TEST(HttpChunkedDecoderTest, LongLengthLengthLine) { … }
}
}