| 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/quic_chromium_client_session.h" | 5 #include "net/quic/quic_chromium_client_session.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 kQuicYieldAfterDurationMilliseconds), | 377 kQuicYieldAfterDurationMilliseconds), |
| 378 bound_net_log_.bound())); | 378 bound_net_log_.bound())); |
| 379 std::unique_ptr<QuicPacketWriter> new_writer( | 379 std::unique_ptr<QuicPacketWriter> new_writer( |
| 380 CreateQuicPacketWriter(new_socket.get(), session_->connection())); | 380 CreateQuicPacketWriter(new_socket.get(), session_->connection())); |
| 381 | 381 |
| 382 // Migrate session. | 382 // Migrate session. |
| 383 EXPECT_TRUE(session_->MigrateToSocket( | 383 EXPECT_TRUE(session_->MigrateToSocket( |
| 384 std::move(new_socket), std::move(new_reader), std::move(new_writer))); | 384 std::move(new_socket), std::move(new_reader), std::move(new_writer))); |
| 385 | 385 |
| 386 // Write data to session. | 386 // Write data to session. |
| 387 QuicChromiumClientStream* stream = |
| 388 session_->CreateOutgoingDynamicStream(kDefaultPriority); |
| 387 struct iovec iov[1]; | 389 struct iovec iov[1]; |
| 388 iov[0].iov_base = data; | 390 iov[0].iov_base = data; |
| 389 iov[0].iov_len = 4; | 391 iov[0].iov_len = 4; |
| 390 session_->WritevData(5, QuicIOVector(iov, arraysize(iov), 4), 0, false, | 392 session_->WritevData(stream, stream->id(), |
| 391 nullptr); | 393 QuicIOVector(iov, arraysize(iov), 4), 0, false, nullptr); |
| 392 | 394 |
| 393 EXPECT_TRUE(socket_data.AllReadDataConsumed()); | 395 EXPECT_TRUE(socket_data.AllReadDataConsumed()); |
| 394 EXPECT_TRUE(socket_data.AllWriteDataConsumed()); | 396 EXPECT_TRUE(socket_data.AllWriteDataConsumed()); |
| 395 } | 397 } |
| 396 | 398 |
| 397 TEST_P(QuicChromiumClientSessionTest, MigrateToSocketMaxReaders) { | 399 TEST_P(QuicChromiumClientSessionTest, MigrateToSocketMaxReaders) { |
| 398 Initialize(); | 400 Initialize(); |
| 399 CompleteCryptoHandshake(); | 401 CompleteCryptoHandshake(); |
| 400 | 402 |
| 401 for (size_t i = 0; i < kMaxReadersPerQuicSession; ++i) { | 403 for (size_t i = 0; i < kMaxReadersPerQuicSession; ++i) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 session_->connection()->SendPing(); | 549 session_->connection()->SendPing(); |
| 548 EXPECT_FALSE(session_->connection()->connected()); | 550 EXPECT_FALSE(session_->connection()->connected()); |
| 549 | 551 |
| 550 EXPECT_TRUE(socket_data.AllReadDataConsumed()); | 552 EXPECT_TRUE(socket_data.AllReadDataConsumed()); |
| 551 EXPECT_TRUE(socket_data.AllWriteDataConsumed()); | 553 EXPECT_TRUE(socket_data.AllWriteDataConsumed()); |
| 552 } | 554 } |
| 553 | 555 |
| 554 } // namespace | 556 } // namespace |
| 555 } // namespace test | 557 } // namespace test |
| 556 } // namespace net | 558 } // namespace net |
| OLD | NEW |