| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 INSTANTIATE_TEST_CASE_P(Tests, | 131 INSTANTIATE_TEST_CASE_P(Tests, |
| 132 QuicClientSessionTest, | 132 QuicClientSessionTest, |
| 133 ::testing::ValuesIn(QuicSupportedVersions())); | 133 ::testing::ValuesIn(QuicSupportedVersions())); |
| 134 | 134 |
| 135 TEST_P(QuicClientSessionTest, CryptoConnect) { | 135 TEST_P(QuicClientSessionTest, CryptoConnect) { |
| 136 CompleteCryptoHandshake(); | 136 CompleteCryptoHandshake(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 TEST_P(QuicClientSessionTest, NoEncryptionAfterInitialEncryption) { | 139 TEST_P(QuicClientSessionTest, NoEncryptionAfterInitialEncryption) { |
| 140 ValueRestore<bool> old_flag(&FLAGS_quic_block_unencrypted_writes, true); | |
| 141 // Complete a handshake in order to prime the crypto config for 0-RTT. | 140 // Complete a handshake in order to prime the crypto config for 0-RTT. |
| 142 CompleteCryptoHandshake(); | 141 CompleteCryptoHandshake(); |
| 143 | 142 |
| 144 // Now create a second session using the same crypto config. | 143 // Now create a second session using the same crypto config. |
| 145 Initialize(); | 144 Initialize(); |
| 146 | 145 |
| 147 // Starting the handshake should move immediately to encryption | 146 // Starting the handshake should move immediately to encryption |
| 148 // established and will allow streams to be created. | 147 // established and will allow streams to be created. |
| 149 session_->CryptoConnect(); | 148 session_->CryptoConnect(); |
| 150 EXPECT_TRUE(session_->IsEncryptionEstablished()); | 149 EXPECT_TRUE(session_->IsEncryptionEstablished()); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 QuicClientPromisedInfo* promised = | 491 QuicClientPromisedInfo* promised = |
| 493 session_->GetPromisedById(promised_stream_id_); | 492 session_->GetPromisedById(promised_stream_id_); |
| 494 EXPECT_NE(promised, nullptr); | 493 EXPECT_NE(promised, nullptr); |
| 495 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); | 494 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); |
| 496 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); | 495 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); |
| 497 } | 496 } |
| 498 | 497 |
| 499 } // namespace | 498 } // namespace |
| 500 } // namespace test | 499 } // namespace test |
| 501 } // namespace net | 500 } // namespace net |
| OLD | NEW |