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/core/quic_session.h" | 5 #include "net/quic/core/quic_session.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 SpdyHeaderBlock headers_; | 275 SpdyHeaderBlock headers_; |
276 }; | 276 }; |
277 | 277 |
278 class QuicSessionTestServer : public QuicSessionTestBase { | 278 class QuicSessionTestServer : public QuicSessionTestBase { |
279 protected: | 279 protected: |
280 QuicSessionTestServer() : QuicSessionTestBase(Perspective::IS_SERVER) {} | 280 QuicSessionTestServer() : QuicSessionTestBase(Perspective::IS_SERVER) {} |
281 }; | 281 }; |
282 | 282 |
283 INSTANTIATE_TEST_CASE_P(Tests, | 283 INSTANTIATE_TEST_CASE_P(Tests, |
284 QuicSessionTestServer, | 284 QuicSessionTestServer, |
285 ::testing::ValuesIn(QuicSupportedVersions())); | 285 ::testing::ValuesIn(AllSupportedVersions())); |
286 | 286 |
287 TEST_P(QuicSessionTestServer, PeerAddress) { | 287 TEST_P(QuicSessionTestServer, PeerAddress) { |
288 EXPECT_EQ(IPEndPoint(Loopback4(), kTestPort), session_.peer_address()); | 288 EXPECT_EQ(IPEndPoint(Loopback4(), kTestPort), session_.peer_address()); |
289 } | 289 } |
290 | 290 |
291 TEST_P(QuicSessionTestServer, IsCryptoHandshakeConfirmed) { | 291 TEST_P(QuicSessionTestServer, IsCryptoHandshakeConfirmed) { |
292 EXPECT_FALSE(session_.IsCryptoHandshakeConfirmed()); | 292 EXPECT_FALSE(session_.IsCryptoHandshakeConfirmed()); |
293 CryptoHandshakeMessage message; | 293 CryptoHandshakeMessage message; |
294 session_.GetCryptoStream()->OnHandshakeMessage(message); | 294 session_.GetCryptoStream()->OnHandshakeMessage(message); |
295 EXPECT_TRUE(session_.IsCryptoHandshakeConfirmed()); | 295 EXPECT_TRUE(session_.IsCryptoHandshakeConfirmed()); |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 } | 1173 } |
1174 } | 1174 } |
1175 | 1175 |
1176 class QuicSessionTestClient : public QuicSessionTestBase { | 1176 class QuicSessionTestClient : public QuicSessionTestBase { |
1177 protected: | 1177 protected: |
1178 QuicSessionTestClient() : QuicSessionTestBase(Perspective::IS_CLIENT) {} | 1178 QuicSessionTestClient() : QuicSessionTestBase(Perspective::IS_CLIENT) {} |
1179 }; | 1179 }; |
1180 | 1180 |
1181 INSTANTIATE_TEST_CASE_P(Tests, | 1181 INSTANTIATE_TEST_CASE_P(Tests, |
1182 QuicSessionTestClient, | 1182 QuicSessionTestClient, |
1183 ::testing::ValuesIn(QuicSupportedVersions())); | 1183 ::testing::ValuesIn(AllSupportedVersions())); |
1184 | 1184 |
1185 TEST_P(QuicSessionTestClient, AvailableStreamsClient) { | 1185 TEST_P(QuicSessionTestClient, AvailableStreamsClient) { |
1186 ASSERT_TRUE(session_.GetOrCreateDynamicStream(6) != nullptr); | 1186 ASSERT_TRUE(session_.GetOrCreateDynamicStream(6) != nullptr); |
1187 // Both 2 and 4 should be available. | 1187 // Both 2 and 4 should be available. |
1188 EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 2)); | 1188 EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 2)); |
1189 EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 4)); | 1189 EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 4)); |
1190 ASSERT_TRUE(session_.GetOrCreateDynamicStream(2) != nullptr); | 1190 ASSERT_TRUE(session_.GetOrCreateDynamicStream(2) != nullptr); |
1191 ASSERT_TRUE(session_.GetOrCreateDynamicStream(4) != nullptr); | 1191 ASSERT_TRUE(session_.GetOrCreateDynamicStream(4) != nullptr); |
1192 // And 5 should be not available. | 1192 // And 5 should be not available. |
1193 EXPECT_FALSE(QuicSessionPeer::IsStreamAvailable(&session_, 5)); | 1193 EXPECT_FALSE(QuicSessionPeer::IsStreamAvailable(&session_, 5)); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 if (version() <= QUIC_VERSION_35) { | 1254 if (version() <= QUIC_VERSION_35) { |
1255 EXPECT_FALSE(session_.force_hol_blocking()); | 1255 EXPECT_FALSE(session_.force_hol_blocking()); |
1256 } else { | 1256 } else { |
1257 EXPECT_TRUE(session_.force_hol_blocking()); | 1257 EXPECT_TRUE(session_.force_hol_blocking()); |
1258 } | 1258 } |
1259 } | 1259 } |
1260 | 1260 |
1261 } // namespace | 1261 } // namespace |
1262 } // namespace test | 1262 } // namespace test |
1263 } // namespace net | 1263 } // namespace net |
OLD | NEW |