| OLD | NEW |
| 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_crypto_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 namespace test { | 36 namespace test { |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class QuicCryptoServerStreamTest : public ::testing::Test { | 39 class QuicCryptoServerStreamTest : public ::testing::Test { |
| 40 public: | 40 public: |
| 41 QuicCryptoServerStreamTest() | 41 QuicCryptoServerStreamTest() |
| 42 : guid_(1), | 42 : guid_(1), |
| 43 addr_(ParseIPLiteralToNumber("192.0.2.33", &ip_) ? | 43 addr_(ParseIPLiteralToNumber("192.0.2.33", &ip_) ? |
| 44 ip_ : IPAddressNumber(), 1), | 44 ip_ : IPAddressNumber(), 1), |
| 45 connection_(new PacketSavingConnection(guid_, addr_, true)), | 45 connection_(new PacketSavingConnection(guid_, addr_, true)), |
| 46 session_(connection_, QuicConfig(), true), | 46 session_(connection_, DefaultQuicConfig(), true), |
| 47 crypto_config_(QuicCryptoServerConfig::TESTING, | 47 crypto_config_(QuicCryptoServerConfig::TESTING, |
| 48 QuicRandom::GetInstance()), | 48 QuicRandom::GetInstance()), |
| 49 stream_(crypto_config_, &session_) { | 49 stream_(crypto_config_, &session_) { |
| 50 config_.SetDefaults(); | 50 config_.SetDefaults(); |
| 51 session_.config()->SetDefaults(); | 51 session_.config()->SetDefaults(); |
| 52 session_.SetCryptoStream(&stream_); | 52 session_.SetCryptoStream(&stream_); |
| 53 // We advance the clock initially because the default time is zero and the | 53 // We advance the clock initially because the default time is zero and the |
| 54 // strike register worries that we've just overflowed a uint32 time. | 54 // strike register worries that we've just overflowed a uint32 time. |
| 55 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(100000)); | 55 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(100000)); |
| 56 // TODO(rtenneti): Enable testing of ProofSource. | 56 // TODO(rtenneti): Enable testing of ProofSource. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // CompleteCryptoHandshake verifies | 202 // CompleteCryptoHandshake verifies |
| 203 // stream_.crypto_negotiated_params().channel_id is correct. | 203 // stream_.crypto_negotiated_params().channel_id is correct. |
| 204 EXPECT_EQ(2, CompleteCryptoHandshake()); | 204 EXPECT_EQ(2, CompleteCryptoHandshake()); |
| 205 EXPECT_TRUE(stream_.encryption_established()); | 205 EXPECT_TRUE(stream_.encryption_established()); |
| 206 EXPECT_TRUE(stream_.handshake_confirmed()); | 206 EXPECT_TRUE(stream_.handshake_confirmed()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace | 209 } // namespace |
| 210 } // namespace test | 210 } // namespace test |
| 211 } // namespace net | 211 } // namespace net |
| OLD | NEW |