| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 static string GetPrimaryOrbit(const QuicCryptoServerConfig& config) { | 42 static string GetPrimaryOrbit(const QuicCryptoServerConfig& config) { |
| 43 base::AutoLock lock(config.configs_lock_); | 43 base::AutoLock lock(config.configs_lock_); |
| 44 CHECK(config.primary_config_ != NULL); | 44 CHECK(config.primary_config_ != NULL); |
| 45 return string(reinterpret_cast<const char*>(config.primary_config_->orbit), | 45 return string(reinterpret_cast<const char*>(config.primary_config_->orbit), |
| 46 kOrbitSize); | 46 kOrbitSize); |
| 47 } | 47 } |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 namespace { | 50 namespace { |
| 51 | 51 |
| 52 class QuicCryptoServerStreamTest : public testing::TestWithParam<bool> { | 52 class QuicCryptoServerStreamTest : public ::testing::TestWithParam<bool> { |
| 53 public: | 53 public: |
| 54 QuicCryptoServerStreamTest() | 54 QuicCryptoServerStreamTest() |
| 55 : connection_(new PacketSavingConnection(true)), | 55 : connection_(new PacketSavingConnection(true)), |
| 56 session_(connection_, DefaultQuicConfig()), | 56 session_(connection_, DefaultQuicConfig()), |
| 57 crypto_config_(QuicCryptoServerConfig::TESTING, | 57 crypto_config_(QuicCryptoServerConfig::TESTING, |
| 58 QuicRandom::GetInstance()), | 58 QuicRandom::GetInstance()), |
| 59 stream_(crypto_config_, &session_), | 59 stream_(crypto_config_, &session_), |
| 60 strike_register_client_(NULL) { | 60 strike_register_client_(NULL) { |
| 61 config_.SetDefaults(); | 61 config_.SetDefaults(); |
| 62 session_.config()->SetDefaults(); | 62 session_.config()->SetDefaults(); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // CompleteCryptoHandshake verifies | 253 // CompleteCryptoHandshake verifies |
| 254 // stream_.crypto_negotiated_params().channel_id is correct. | 254 // stream_.crypto_negotiated_params().channel_id is correct. |
| 255 EXPECT_EQ(2, CompleteCryptoHandshake()); | 255 EXPECT_EQ(2, CompleteCryptoHandshake()); |
| 256 EXPECT_TRUE(stream_.encryption_established()); | 256 EXPECT_TRUE(stream_.encryption_established()); |
| 257 EXPECT_TRUE(stream_.handshake_confirmed()); | 257 EXPECT_TRUE(stream_.handshake_confirmed()); |
| 258 } | 258 } |
| 259 | 259 |
| 260 } // namespace | 260 } // namespace |
| 261 } // namespace test | 261 } // namespace test |
| 262 } // namespace net | 262 } // namespace net |
| OLD | NEW |