| Index: net/tools/balsa/balsa_frame_test.cc
|
| diff --git a/net/tools/balsa/balsa_frame_test.cc b/net/tools/balsa/balsa_frame_test.cc
|
| index 2582721b3a93c4be0a591fc28bd8765222140163..1eb67a7efb348fd92718b2664e1411421270a0ff 100644
|
| --- a/net/tools/balsa/balsa_frame_test.cc
|
| +++ b/net/tools/balsa/balsa_frame_test.cc
|
| @@ -30,22 +30,24 @@ class Visitor : public BalsaVisitorInterface {
|
| MOCK_METHOD2(ProcessHeaderInput, void(const char*, size_t));
|
| MOCK_METHOD2(ProcessTrailerInput, void(const char*, size_t));
|
| MOCK_METHOD1(ProcessHeaders, void(const BalsaHeaders&));
|
| - MOCK_METHOD8(ProcessRequestFirstLine, void(const char*,
|
| - size_t,
|
| - const char*,
|
| - size_t,
|
| - const char*,
|
| - size_t,
|
| - const char*,
|
| - size_t));
|
| - MOCK_METHOD8(ProcessResponseFirstLine, void(const char*,
|
| - size_t,
|
| - const char*,
|
| - size_t,
|
| - const char*,
|
| - size_t,
|
| - const char*,
|
| - size_t));
|
| + MOCK_METHOD8(ProcessRequestFirstLine,
|
| + void(const char*,
|
| + size_t,
|
| + const char*,
|
| + size_t,
|
| + const char*,
|
| + size_t,
|
| + const char*,
|
| + size_t));
|
| + MOCK_METHOD8(ProcessResponseFirstLine,
|
| + void(const char*,
|
| + size_t,
|
| + const char*,
|
| + size_t,
|
| + const char*,
|
| + size_t,
|
| + const char*,
|
| + size_t));
|
| MOCK_METHOD2(ProcessChunkExtensions, void(const char*, size_t));
|
| MOCK_METHOD1(ProcessChunkLength, void(size_t));
|
| MOCK_METHOD0(HeaderDone, void());
|
| @@ -153,7 +155,8 @@ TEST_F(BalsaFrameTest, GetRequest) {
|
| }
|
|
|
| TEST_F(BalsaFrameTest, HeadResponse) {
|
| - const char input[] = "HTTP/1.1 200 OK\r\n"
|
| + const char input[] =
|
| + "HTTP/1.1 200 OK\r\n"
|
| "Content-type: text/plain\r\n"
|
| "Content-Length: 14\r\n\r\n";
|
| const char* line = NULL;
|
| @@ -200,14 +203,16 @@ TEST_F(BalsaFrameTest, HeadResponse) {
|
| ASSERT_EQ("HTTP/1.1", StringPiece(version, version_length));
|
| ASSERT_EQ("200", StringPiece(status, status_length));
|
| ASSERT_EQ("OK", StringPiece(reason, reason_length));
|
| - ASSERT_EQ("HTTP/1.1 200 OK\r\n"
|
| - "Content-type: text/plain\r\n"
|
| - "Content-Length: 14\r\n\r\n",
|
| - StringPiece(header, header_length));
|
| + ASSERT_EQ(
|
| + "HTTP/1.1 200 OK\r\n"
|
| + "Content-type: text/plain\r\n"
|
| + "Content-Length: 14\r\n\r\n",
|
| + StringPiece(header, header_length));
|
| }
|
|
|
| TEST_F(BalsaFrameTest, GetResponse) {
|
| - const char input[] = "HTTP/1.1 200 OK\r\n"
|
| + const char input[] =
|
| + "HTTP/1.1 200 OK\r\n"
|
| "Content-type: text/plain\r\n"
|
| "Content-Length: 14\r\n\r\n"
|
| "hello, world\r\n";
|
| @@ -268,10 +273,11 @@ TEST_F(BalsaFrameTest, GetResponse) {
|
| ASSERT_EQ("HTTP/1.1", StringPiece(version, version_length));
|
| ASSERT_EQ("200", StringPiece(status, status_length));
|
| ASSERT_EQ("OK", StringPiece(reason, reason_length));
|
| - ASSERT_EQ("HTTP/1.1 200 OK\r\n"
|
| - "Content-type: text/plain\r\n"
|
| - "Content-Length: 14\r\n\r\n",
|
| - StringPiece(header, header_length));
|
| + ASSERT_EQ(
|
| + "HTTP/1.1 200 OK\r\n"
|
| + "Content-type: text/plain\r\n"
|
| + "Content-Length: 14\r\n\r\n",
|
| + StringPiece(header, header_length));
|
| ASSERT_EQ("hello, world\r\n", StringPiece(body, body_length));
|
| ASSERT_EQ("hello, world\r\n", StringPiece(body_data, body_data_length));
|
| }
|
| @@ -304,7 +310,8 @@ TEST_F(BalsaFrameTest, Reset) {
|
| }
|
|
|
| TEST_F(BalsaFrameTest, InvalidStatusCode) {
|
| - const char input[] = "HTTP/1.1 InvalidStatusCode OK\r\n"
|
| + const char input[] =
|
| + "HTTP/1.1 InvalidStatusCode OK\r\n"
|
| "Content-type: text/plain\r\n"
|
| "Content-Length: 14\r\n\r\n"
|
| "hello, world\r\n";
|
| @@ -328,7 +335,8 @@ TEST_F(BalsaFrameTest, InvalidStatusCode) {
|
| }
|
|
|
| TEST_F(BalsaFrameTest, ResetError) {
|
| - const char input[] = "HTTP/1.1 InvalidStatusCode OK\r\n"
|
| + const char input[] =
|
| + "HTTP/1.1 InvalidStatusCode OK\r\n"
|
| "Content-type: text/plain\r\n"
|
| "Content-Length: 14\r\n\r\n"
|
| "hello, world\r\n";
|
| @@ -398,7 +406,8 @@ TEST_F(BalsaFrameTest, HeadersTooLong) {
|
| }
|
|
|
| TEST_F(BalsaFrameTest, InvalidHeader) {
|
| - const char input[] = "GET / HTTP/1.0\r\n"
|
| + const char input[] =
|
| + "GET / HTTP/1.0\r\n"
|
| "foo bar baz\r\n"
|
| "Content-Type: text/plain\r\n\r\n";
|
| const char* line = NULL;
|
| @@ -441,12 +450,14 @@ TEST_F(BalsaFrameTest, InvalidHeader) {
|
| ASSERT_EQ("GET", StringPiece(method, method_length));
|
| ASSERT_EQ("/", StringPiece(request_uri, request_uri_length));
|
| ASSERT_EQ("HTTP/1.0", StringPiece(version, version_length));
|
| - ASSERT_EQ(2, std::distance(frame_headers_->header_lines_begin(),
|
| - frame_headers_->header_lines_end()));
|
| + ASSERT_EQ(2,
|
| + std::distance(frame_headers_->header_lines_begin(),
|
| + frame_headers_->header_lines_end()));
|
| }
|
|
|
| TEST_F(BalsaFrameTest, GetResponseSplit) {
|
| - const char input[] = "HTTP/1.1 200 OK\r\n"
|
| + const char input[] =
|
| + "HTTP/1.1 200 OK\r\n"
|
| "Content-type: text/plain\r\n"
|
| "Content-Length: 14\r\n\r\n"
|
| "hello";
|
| @@ -473,15 +484,13 @@ TEST_F(BalsaFrameTest, GetResponseSplit) {
|
| EXPECT_CALL(checkpoint, Call(0));
|
| EXPECT_CALL(*visitor_, ProcessBodyInput(_, _))
|
| .WillOnce(DoAll(SaveArg<0>(&body1), SaveArg<1>(&body1_length)));
|
| - EXPECT_CALL(*visitor_, ProcessBodyData(_, _))
|
| - .WillOnce(DoAll(SaveArg<0>(&body1_data),
|
| - SaveArg<1>(&body1_data_length)));
|
| + EXPECT_CALL(*visitor_, ProcessBodyData(_, _)).WillOnce(
|
| + DoAll(SaveArg<0>(&body1_data), SaveArg<1>(&body1_data_length)));
|
| EXPECT_CALL(checkpoint, Call(1));
|
| EXPECT_CALL(*visitor_, ProcessBodyInput(_, _))
|
| .WillOnce(DoAll(SaveArg<0>(&body2), SaveArg<1>(&body2_length)));
|
| - EXPECT_CALL(*visitor_, ProcessBodyData(_, _))
|
| - .WillOnce(DoAll(SaveArg<0>(&body2_data),
|
| - SaveArg<1>(&body2_data_length)));
|
| + EXPECT_CALL(*visitor_, ProcessBodyData(_, _)).WillOnce(
|
| + DoAll(SaveArg<0>(&body2_data), SaveArg<1>(&body2_data_length)));
|
| EXPECT_CALL(*visitor_, MessageDone());
|
| }
|
|
|
| @@ -508,7 +517,8 @@ TEST_F(BalsaFrameTest, GetResponseSplit) {
|
| }
|
|
|
| TEST_F(BalsaFrameTest, GetResponseBytesSpliced) {
|
| - const char input[] = "HTTP/1.1 200 OK\r\n"
|
| + const char input[] =
|
| + "HTTP/1.1 200 OK\r\n"
|
| "Content-type: text/plain\r\n"
|
| "Content-Length: 14\r\n\r\n"
|
| "hello";
|
| @@ -553,7 +563,8 @@ TEST_F(BalsaFrameTest, GetResponseBytesSpliced) {
|
| }
|
|
|
| TEST_F(BalsaFrameTest, GetResponseBytesSplicedTooMany) {
|
| - const char input[] = "HTTP/1.1 200 OK\r\n"
|
| + const char input[] =
|
| + "HTTP/1.1 200 OK\r\n"
|
| "Content-type: text/plain\r\n"
|
| "Content-Length: 14\r\n\r\n"
|
| "hello";
|
|
|