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/chromium/quic_chromium_client_session.h" | 5 #include "net/quic/chromium/quic_chromium_client_session.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 // Spin message loop to complete migration. | 785 // Spin message loop to complete migration. |
786 base::RunLoop().RunUntilIdle(); | 786 base::RunLoop().RunUntilIdle(); |
787 | 787 |
788 // Write data to session. | 788 // Write data to session. |
789 QuicChromiumClientStream* stream = | 789 QuicChromiumClientStream* stream = |
790 session_->CreateOutgoingDynamicStream(kDefaultPriority); | 790 session_->CreateOutgoingDynamicStream(kDefaultPriority); |
791 struct iovec iov[1]; | 791 struct iovec iov[1]; |
792 iov[0].iov_base = data; | 792 iov[0].iov_base = data; |
793 iov[0].iov_len = 4; | 793 iov[0].iov_len = 4; |
794 session_->WritevData(stream, stream->id(), | 794 session_->WritevData(stream, stream->id(), |
795 QuicIOVector(iov, arraysize(iov), 4), 0, false, nullptr); | 795 QuicIOVector(iov, arraysize(iov), 4), 0, NO_FIN, nullptr)
; |
796 | 796 |
797 EXPECT_TRUE(socket_data.AllReadDataConsumed()); | 797 EXPECT_TRUE(socket_data.AllReadDataConsumed()); |
798 EXPECT_TRUE(socket_data.AllWriteDataConsumed()); | 798 EXPECT_TRUE(socket_data.AllWriteDataConsumed()); |
799 } | 799 } |
800 | 800 |
801 TEST_P(QuicChromiumClientSessionTest, MigrateToSocketMaxReaders) { | 801 TEST_P(QuicChromiumClientSessionTest, MigrateToSocketMaxReaders) { |
802 MockRead old_reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)}; | 802 MockRead old_reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)}; |
803 std::unique_ptr<QuicEncryptedPacket> settings_packet( | 803 std::unique_ptr<QuicEncryptedPacket> settings_packet( |
804 client_maker_.MakeSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE, | 804 client_maker_.MakeSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE, |
805 kDefaultMaxUncompressedHeaderSize, true, | 805 kDefaultMaxUncompressedHeaderSize, true, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 | 924 |
925 EXPECT_TRUE(socket_data_->AllReadDataConsumed()); | 925 EXPECT_TRUE(socket_data_->AllReadDataConsumed()); |
926 EXPECT_TRUE(socket_data_->AllWriteDataConsumed()); | 926 EXPECT_TRUE(socket_data_->AllWriteDataConsumed()); |
927 EXPECT_TRUE(new_socket_data.AllReadDataConsumed()); | 927 EXPECT_TRUE(new_socket_data.AllReadDataConsumed()); |
928 EXPECT_TRUE(new_socket_data.AllWriteDataConsumed()); | 928 EXPECT_TRUE(new_socket_data.AllWriteDataConsumed()); |
929 } | 929 } |
930 | 930 |
931 } // namespace | 931 } // namespace |
932 } // namespace test | 932 } // namespace test |
933 } // namespace net | 933 } // namespace net |
OLD | NEW |