Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 1500053002: Merge: Fix HttpStreamParser::CanReuseConnection(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_stream_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 5301 matching lines...) Expand 10 before | Expand all | Expand 10 after
5312 "GET / HTTP/1.1\r\n" 5312 "GET / HTTP/1.1\r\n"
5313 "Host: www.example.org\r\n" 5313 "Host: www.example.org\r\n"
5314 "Connection: keep-alive\r\n\r\n"), 5314 "Connection: keep-alive\r\n\r\n"),
5315 MockWrite( 5315 MockWrite(
5316 "GET / HTTP/1.1\r\n" 5316 "GET / HTTP/1.1\r\n"
5317 "Host: www.example.org\r\n" 5317 "Host: www.example.org\r\n"
5318 "Connection: keep-alive\r\n\r\n"), 5318 "Connection: keep-alive\r\n\r\n"),
5319 }; 5319 };
5320 5320
5321 MockRead data_reads[] = { 5321 MockRead data_reads[] = {
5322 MockRead("HTTP/1.1 200 OK\r\n"), 5322 MockRead("HTTP/1.1 200 OK\r\n"), MockRead("Content-Length: 11\r\n\r\n"),
5323 MockRead("Content-Length: 11\r\n\r\n"), 5323 MockRead("hello world"), MockRead(ASYNC, ERR_CONNECTION_CLOSED)};
5324 MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ),
5325 MockRead("hello world"),
5326 MockRead(ASYNC, 0, 0) // EOF
5327 };
5328 5324
5329 SSLSocketDataProvider ssl(ASYNC, OK); 5325 SSLSocketDataProvider ssl(ASYNC, OK);
5330 SSLSocketDataProvider ssl2(ASYNC, OK); 5326 SSLSocketDataProvider ssl2(ASYNC, OK);
5331 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); 5327 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
5332 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2); 5328 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2);
5333 5329
5334 StaticSocketDataProvider data(data_reads, arraysize(data_reads), 5330 StaticSocketDataProvider data(data_reads, arraysize(data_reads),
5335 data_writes, arraysize(data_writes)); 5331 data_writes, arraysize(data_writes));
5336 StaticSocketDataProvider data2(data_reads, arraysize(data_reads), 5332 StaticSocketDataProvider data2(data_reads, arraysize(data_reads),
5337 data_writes, arraysize(data_writes)); 5333 data_writes, arraysize(data_writes));
(...skipping 9433 matching lines...) Expand 10 before | Expand all | Expand 10 after
14771 std::string response_data; 14767 std::string response_data;
14772 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); 14768 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data));
14773 14769
14774 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), 14770 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)),
14775 trans->GetTotalSentBytes()); 14771 trans->GetTotalSentBytes());
14776 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), 14772 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)),
14777 trans->GetTotalReceivedBytes()); 14773 trans->GetTotalReceivedBytes());
14778 } 14774 }
14779 14775
14780 } // namespace net 14776 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698