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

Side by Side Diff: net/tools/quic/quic_client_session_test.cc

Issue 47283002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | net/tools/quic/quic_dispatcher.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 (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/tools/quic/quic_client_session.h" 5 #include "net/tools/quic/quic_client_session.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "net/base/ip_endpoint.h" 9 #include "net/base/ip_endpoint.h"
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h"
11 #include "net/quic/test_tools/crypto_test_utils.h" 11 #include "net/quic/test_tools/crypto_test_utils.h"
12 #include "net/quic/test_tools/quic_test_utils.h" 12 #include "net/quic/test_tools/quic_test_utils.h"
13 #include "net/tools/quic/quic_reliable_client_stream.h" 13 #include "net/tools/quic/quic_reliable_client_stream.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 using net::test::CryptoTestUtils;
17 using net::test::DefaultQuicConfig;
18 using net::test::PacketSavingConnection;
16 using testing::_; 19 using testing::_;
17 using net::test::CryptoTestUtils;
18 using net::test::PacketSavingConnection;
19 20
20 namespace net { 21 namespace net {
21 namespace tools { 22 namespace tools {
22 namespace test { 23 namespace test {
23 namespace { 24 namespace {
24 25
25 const char kServerHostname[] = "www.example.com"; 26 const char kServerHostname[] = "www.example.com";
26 27
27 class ToolsQuicClientSessionTest : public ::testing::Test { 28 class ToolsQuicClientSessionTest : public ::testing::Test {
28 protected: 29 protected:
29 ToolsQuicClientSessionTest() 30 ToolsQuicClientSessionTest()
30 : guid_(1), 31 : guid_(1),
31 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)) { 32 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)) {
32 crypto_config_.SetDefaults(); 33 crypto_config_.SetDefaults();
33 session_.reset(new QuicClientSession(kServerHostname, QuicConfig(), 34 session_.reset(new QuicClientSession(kServerHostname, DefaultQuicConfig(),
34 connection_, &crypto_config_)); 35 connection_, &crypto_config_));
35 session_->config()->SetDefaults(); 36 session_->config()->SetDefaults();
36 } 37 }
37 38
38 void CompleteCryptoHandshake() { 39 void CompleteCryptoHandshake() {
39 ASSERT_TRUE(session_->CryptoConnect()); 40 ASSERT_TRUE(session_->CryptoConnect());
40 CryptoTestUtils::HandshakeWithFakeServer( 41 CryptoTestUtils::HandshakeWithFakeServer(
41 connection_, session_->GetCryptoStream()); 42 connection_, session_->GetCryptoStream());
42 } 43 }
43 44
(...skipping 30 matching lines...) Expand all
74 // After receiving a GoAway, I should no longer be able to create outgoing 75 // After receiving a GoAway, I should no longer be able to create outgoing
75 // streams. 76 // streams.
76 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); 77 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away."));
77 EXPECT_EQ(NULL, session_->CreateOutgoingReliableStream()); 78 EXPECT_EQ(NULL, session_->CreateOutgoingReliableStream());
78 } 79 }
79 80
80 } // namespace 81 } // namespace
81 } // namespace test 82 } // namespace test
82 } // namespace tools 83 } // namespace tools
83 } // namespace net 84 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698