| 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/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 "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 // Now create a second session using the same crypto config. | 144 // Now create a second session using the same crypto config. |
| 145 Initialize(); | 145 Initialize(); |
| 146 | 146 |
| 147 // Starting the handshake should move immediately to encryption | 147 // Starting the handshake should move immediately to encryption |
| 148 // established and will allow streams to be created. | 148 // established and will allow streams to be created. |
| 149 session_->CryptoConnect(); | 149 session_->CryptoConnect(); |
| 150 EXPECT_TRUE(session_->IsEncryptionEstablished()); | 150 EXPECT_TRUE(session_->IsEncryptionEstablished()); |
| 151 QuicSpdyClientStream* stream = | 151 QuicSpdyClientStream* stream = |
| 152 session_->CreateOutgoingDynamicStream(kDefaultPriority); | 152 session_->CreateOutgoingDynamicStream(kDefaultPriority); |
| 153 DCHECK_NE(kCryptoStreamId, stream->id()); | 153 ASSERT_TRUE(stream != nullptr); |
| 154 EXPECT_TRUE(stream != nullptr); | 154 EXPECT_NE(kCryptoStreamId, stream->id()); |
| 155 | 155 |
| 156 // Process an "inchoate" REJ from the server which will cause | 156 // Process an "inchoate" REJ from the server which will cause |
| 157 // an inchoate CHLO to be sent and will leave the encryption level | 157 // an inchoate CHLO to be sent and will leave the encryption level |
| 158 // at NONE. | 158 // at NONE. |
| 159 CryptoHandshakeMessage rej; | 159 CryptoHandshakeMessage rej; |
| 160 CryptoTestUtils::FillInDummyReject(&rej, /* stateless */ false); | 160 CryptoTestUtils::FillInDummyReject(&rej, /* stateless */ false); |
| 161 EXPECT_TRUE(session_->IsEncryptionEstablished()); | 161 EXPECT_TRUE(session_->IsEncryptionEstablished()); |
| 162 session_->GetCryptoStream()->OnHandshakeMessage(rej); | 162 session_->GetCryptoStream()->OnHandshakeMessage(rej); |
| 163 EXPECT_FALSE(session_->IsEncryptionEstablished()); | 163 EXPECT_FALSE(session_->IsEncryptionEstablished()); |
| 164 EXPECT_EQ(ENCRYPTION_NONE, | 164 EXPECT_EQ(ENCRYPTION_NONE, |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 QuicClientPromisedInfo* promised = | 492 QuicClientPromisedInfo* promised = |
| 493 session_->GetPromisedById(promised_stream_id_); | 493 session_->GetPromisedById(promised_stream_id_); |
| 494 EXPECT_NE(promised, nullptr); | 494 EXPECT_NE(promised, nullptr); |
| 495 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); | 495 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); |
| 496 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); | 496 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); |
| 497 } | 497 } |
| 498 | 498 |
| 499 } // namespace | 499 } // namespace |
| 500 } // namespace test | 500 } // namespace test |
| 501 } // namespace net | 501 } // namespace net |
| OLD | NEW |