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

Side by Side Diff: net/quic/quic_http_stream_test.cc

Issue 1305293004: Notfiy NQE of QUIC RTT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 3 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/quic/quic_http_stream.h" 5 #include "net/quic/quic_http_stream.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
12 #include "net/base/chunked_upload_data_stream.h" 12 #include "net/base/chunked_upload_data_stream.h"
13 #include "net/base/elements_upload_data_stream.h" 13 #include "net/base/elements_upload_data_stream.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "net/base/socket_performance_watcher.h"
15 #include "net/base/test_completion_callback.h" 16 #include "net/base/test_completion_callback.h"
16 #include "net/base/upload_bytes_element_reader.h" 17 #include "net/base/upload_bytes_element_reader.h"
17 #include "net/http/http_response_headers.h" 18 #include "net/http/http_response_headers.h"
18 #include "net/http/transport_security_state.h" 19 #include "net/http/transport_security_state.h"
19 #include "net/quic/congestion_control/send_algorithm_interface.h" 20 #include "net/quic/congestion_control/send_algorithm_interface.h"
20 #include "net/quic/crypto/crypto_protocol.h" 21 #include "net/quic/crypto/crypto_protocol.h"
21 #include "net/quic/crypto/quic_decrypter.h" 22 #include "net/quic/crypto/quic_decrypter.h"
22 #include "net/quic/crypto/quic_encrypter.h" 23 #include "net/quic/crypto/quic_encrypter.h"
23 #include "net/quic/crypto/quic_server_info.h" 24 #include "net/quic/crypto/quic_server_info.h"
24 #include "net/quic/quic_chromium_client_session.h" 25 #include "net/quic/quic_chromium_client_session.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 connection_->set_visitor(&visitor_); 217 connection_->set_visitor(&visitor_);
217 connection_->SetSendAlgorithm(send_algorithm_); 218 connection_->SetSendAlgorithm(send_algorithm_);
218 session_.reset(new QuicChromiumClientSession( 219 session_.reset(new QuicChromiumClientSession(
219 connection_, scoped_ptr<DatagramClientSocket>(socket), 220 connection_, scoped_ptr<DatagramClientSocket>(socket),
220 /*stream_factory=*/nullptr, &crypto_client_stream_factory_, 221 /*stream_factory=*/nullptr, &crypto_client_stream_factory_,
221 &transport_security_state_, make_scoped_ptr((QuicServerInfo*)nullptr), 222 &transport_security_state_, make_scoped_ptr((QuicServerInfo*)nullptr),
222 QuicServerId(kDefaultServerHostName, kDefaultServerPort, 223 QuicServerId(kDefaultServerHostName, kDefaultServerPort,
223 /*is_secure=*/false, PRIVACY_MODE_DISABLED), 224 /*is_secure=*/false, PRIVACY_MODE_DISABLED),
224 /*cert_verify_flags=*/0, DefaultQuicConfig(), &crypto_config_, 225 /*cert_verify_flags=*/0, DefaultQuicConfig(), &crypto_config_,
225 "CONNECTION_UNKNOWN", base::TimeTicks::Now(), 226 "CONNECTION_UNKNOWN", base::TimeTicks::Now(),
226 base::ThreadTaskRunnerHandle::Get().get(), nullptr)); 227 base::ThreadTaskRunnerHandle::Get().get(),
228 scoped_ptr<SocketPerformanceWatcher>(), nullptr));
Ryan Sleevi 2015/09/18 17:36:45 nullptr
tbansal1 2015/09/18 17:59:59 Done.
227 session_->Initialize(); 229 session_->Initialize();
228 session_->GetCryptoStream()->CryptoConnect(); 230 session_->GetCryptoStream()->CryptoConnect();
229 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); 231 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed());
230 stream_.reset(use_closing_stream_ ? 232 stream_.reset(use_closing_stream_ ?
231 new AutoClosingStream(session_->GetWeakPtr()) : 233 new AutoClosingStream(session_->GetWeakPtr()) :
232 new QuicHttpStream(session_->GetWeakPtr())); 234 new QuicHttpStream(session_->GetWeakPtr()));
233 } 235 }
234 236
235 void SetRequest(const std::string& method, 237 void SetRequest(const std::string& method,
236 const std::string& path, 238 const std::string& path,
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 reliable_stream->SetDelegate(delegate); 840 reliable_stream->SetDelegate(delegate);
839 841
840 // QuicHttpStream::GetTotalSent/ReceivedBytes currently only includes the 842 // QuicHttpStream::GetTotalSent/ReceivedBytes currently only includes the
841 // payload. 843 // payload.
842 EXPECT_EQ(0, stream_->GetTotalSentBytes()); 844 EXPECT_EQ(0, stream_->GetTotalSentBytes());
843 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); 845 EXPECT_EQ(0, stream_->GetTotalReceivedBytes());
844 } 846 }
845 847
846 } // namespace test 848 } // namespace test
847 } // namespace net 849 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698