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 "net/quic/core/crypto/aes_128_gcm_12_encrypter.h" | 9 #include "net/quic/core/crypto/aes_128_gcm_12_encrypter.h" |
10 #include "net/quic/core/quic_flags.h" | 10 #include "net/quic/core/quic_flags.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 QuicPacketCreatorPeer::GetEncryptionLevel( | 159 QuicPacketCreatorPeer::GetEncryptionLevel( |
160 QuicConnectionPeer::GetPacketCreator(connection_))); | 160 QuicConnectionPeer::GetPacketCreator(connection_))); |
161 // Verify that no new streams may be created. | 161 // Verify that no new streams may be created. |
162 EXPECT_TRUE(session_->CreateOutgoingDynamicStream(kDefaultPriority) == | 162 EXPECT_TRUE(session_->CreateOutgoingDynamicStream(kDefaultPriority) == |
163 nullptr); | 163 nullptr); |
164 // Verify that no data may be send on existing streams. | 164 // Verify that no data may be send on existing streams. |
165 char data[] = "hello world"; | 165 char data[] = "hello world"; |
166 struct iovec iov = {data, arraysize(data)}; | 166 struct iovec iov = {data, arraysize(data)}; |
167 QuicIOVector iovector(&iov, 1, iov.iov_len); | 167 QuicIOVector iovector(&iov, 1, iov.iov_len); |
168 QuicConsumedData consumed = | 168 QuicConsumedData consumed = |
169 session_->WritevData(stream, stream->id(), iovector, 0, false, nullptr); | 169 session_->WritevData(stream, stream->id(), iovector, 0, NO_FIN, nullptr); |
170 EXPECT_FALSE(consumed.fin_consumed); | 170 EXPECT_FALSE(consumed.fin_consumed); |
171 EXPECT_EQ(0u, consumed.bytes_consumed); | 171 EXPECT_EQ(0u, consumed.bytes_consumed); |
172 } | 172 } |
173 | 173 |
174 TEST_P(QuicClientSessionTest, MaxNumStreamsWithNoFinOrRst) { | 174 TEST_P(QuicClientSessionTest, MaxNumStreamsWithNoFinOrRst) { |
175 EXPECT_CALL(*connection_, SendRstStream(_, _, _)).Times(AnyNumber()); | 175 EXPECT_CALL(*connection_, SendRstStream(_, _, _)).Times(AnyNumber()); |
176 | 176 |
177 const uint32_t kServerMaxIncomingStreams = 1; | 177 const uint32_t kServerMaxIncomingStreams = 1; |
178 CompleteCryptoHandshake(kServerMaxIncomingStreams); | 178 CompleteCryptoHandshake(kServerMaxIncomingStreams); |
179 | 179 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 QuicClientPromisedInfo* promised = | 484 QuicClientPromisedInfo* promised = |
485 session_->GetPromisedById(promised_stream_id_); | 485 session_->GetPromisedById(promised_stream_id_); |
486 EXPECT_NE(promised, nullptr); | 486 EXPECT_NE(promised, nullptr); |
487 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); | 487 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); |
488 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); | 488 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); |
489 } | 489 } |
490 | 490 |
491 } // namespace | 491 } // namespace |
492 } // namespace test | 492 } // namespace test |
493 } // namespace net | 493 } // namespace net |
OLD | NEW |