| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 QuicPacketCreatorPeer::GetEncryptionLevel( | 168 QuicPacketCreatorPeer::GetEncryptionLevel( |
| 169 QuicConnectionPeer::GetPacketCreator(connection_))); | 169 QuicConnectionPeer::GetPacketCreator(connection_))); |
| 170 // Verify that no new streams may be created. | 170 // Verify that no new streams may be created. |
| 171 EXPECT_TRUE(session_->CreateOutgoingDynamicStream(kDefaultPriority) == | 171 EXPECT_TRUE(session_->CreateOutgoingDynamicStream(kDefaultPriority) == |
| 172 nullptr); | 172 nullptr); |
| 173 // Verify that no data may be send on existing streams. | 173 // Verify that no data may be send on existing streams. |
| 174 char data[] = "hello world"; | 174 char data[] = "hello world"; |
| 175 struct iovec iov = {data, arraysize(data)}; | 175 struct iovec iov = {data, arraysize(data)}; |
| 176 QuicIOVector iovector(&iov, 1, iov.iov_len); | 176 QuicIOVector iovector(&iov, 1, iov.iov_len); |
| 177 QuicConsumedData consumed = | 177 QuicConsumedData consumed = |
| 178 session_->WritevData(stream->id(), iovector, 0, false, nullptr); | 178 session_->WritevData(stream, stream->id(), iovector, 0, false, nullptr); |
| 179 EXPECT_FALSE(consumed.fin_consumed); | 179 EXPECT_FALSE(consumed.fin_consumed); |
| 180 EXPECT_EQ(0u, consumed.bytes_consumed); | 180 EXPECT_EQ(0u, consumed.bytes_consumed); |
| 181 } | 181 } |
| 182 | 182 |
| 183 TEST_P(QuicClientSessionTest, MaxNumStreamsWithNoFinOrRst) { | 183 TEST_P(QuicClientSessionTest, MaxNumStreamsWithNoFinOrRst) { |
| 184 EXPECT_CALL(*connection_, SendRstStream(_, _, _)).Times(AnyNumber()); | 184 EXPECT_CALL(*connection_, SendRstStream(_, _, _)).Times(AnyNumber()); |
| 185 | 185 |
| 186 session_->config()->SetMaxStreamsPerConnection(1, 1); | 186 session_->config()->SetMaxStreamsPerConnection(1, 1); |
| 187 | 187 |
| 188 // Initialize crypto before the client session will create a stream. | 188 // Initialize crypto before the client session will create a stream. |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 QuicClientPromisedInfo* promised = | 510 QuicClientPromisedInfo* promised = |
| 511 session_->GetPromisedById(promised_stream_id_); | 511 session_->GetPromisedById(promised_stream_id_); |
| 512 EXPECT_NE(promised, nullptr); | 512 EXPECT_NE(promised, nullptr); |
| 513 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); | 513 EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr); |
| 514 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); | 514 EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr); |
| 515 } | 515 } |
| 516 | 516 |
| 517 } // namespace | 517 } // namespace |
| 518 } // namespace test | 518 } // namespace test |
| 519 } // namespace net | 519 } // namespace net |
| OLD | NEW |