| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <sys/epoll.h> | 7 #include <sys/epoll.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 GenerateBody(&body, 10240); | 650 GenerateBody(&body, 10240); |
| 651 | 651 |
| 652 HTTPMessage request(HttpConstants::HTTP_1_1, | 652 HTTPMessage request(HttpConstants::HTTP_1_1, |
| 653 HttpConstants::POST, "/foo"); | 653 HttpConstants::POST, "/foo"); |
| 654 request.AddBody(body, true); | 654 request.AddBody(body, true); |
| 655 | 655 |
| 656 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request)); | 656 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request)); |
| 657 VerifyCleanConnection(true); | 657 VerifyCleanConnection(true); |
| 658 } | 658 } |
| 659 | 659 |
| 660 // TODO(rtenneti): DISABLED_LargePostLargeBuffer seems to be flaky. | 660 TEST_P(EndToEndTest, LargePostSmallBandwidthLargeBuffer) { |
| 661 // http://crbug.com/370087. | |
| 662 TEST_P(EndToEndTest, DISABLED_LargePostLargeBuffer) { | |
| 663 ASSERT_TRUE(Initialize()); | 661 ASSERT_TRUE(Initialize()); |
| 664 SetPacketSendDelay(QuicTime::Delta::FromMicroseconds(1)); | 662 SetPacketSendDelay(QuicTime::Delta::FromMicroseconds(1)); |
| 665 // 256KB per second with a 128k buffer from server to client. Wireless | 663 // 256KB per second with a 256k buffer from server to client. Wireless |
| 666 // clients commonly have larger buffers, but our max CWND is 200. | 664 // clients commonly have larger buffers, but our max CWND is 200. |
| 667 server_writer_->set_max_bandwidth_and_buffer_size( | 665 server_writer_->set_max_bandwidth_and_buffer_size( |
| 668 QuicBandwidth::FromBytesPerSecond(256 * 1024), 128 * 1024); | 666 QuicBandwidth::FromBytesPerSecond(256 * 1024), 256 * 1024); |
| 669 | 667 |
| 670 client_->client()->WaitForCryptoHandshakeConfirmed(); | 668 client_->client()->WaitForCryptoHandshakeConfirmed(); |
| 671 | 669 |
| 672 // 1 MB body. | 670 // 1 MB body. |
| 673 string body; | 671 string body; |
| 674 GenerateBody(&body, 1024 * 1024); | 672 GenerateBody(&body, 1024 * 1024); |
| 675 | 673 |
| 676 HTTPMessage request(HttpConstants::HTTP_1_1, | 674 HTTPMessage request(HttpConstants::HTTP_1_1, |
| 677 HttpConstants::POST, "/foo"); | 675 HttpConstants::POST, "/foo"); |
| 678 request.AddBody(body, true); | 676 request.AddBody(body, true); |
| 679 | 677 |
| 680 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request)); | 678 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request)); |
| 679 // This connection will not drop packets, because the buffer size is larger |
| 680 // than the default receive window. |
| 681 VerifyCleanConnection(false); | 681 VerifyCleanConnection(false); |
| 682 } | 682 } |
| 683 | 683 |
| 684 TEST_P(EndToEndTest, InvalidStream) { | 684 TEST_P(EndToEndTest, InvalidStream) { |
| 685 ASSERT_TRUE(Initialize()); | 685 ASSERT_TRUE(Initialize()); |
| 686 client_->client()->WaitForCryptoHandshakeConfirmed(); | 686 client_->client()->WaitForCryptoHandshakeConfirmed(); |
| 687 | 687 |
| 688 string body; | 688 string body; |
| 689 GenerateBody(&body, kMaxPacketSize); | 689 GenerateBody(&body, kMaxPacketSize); |
| 690 | 690 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 QuicSession* session = dispatcher->session_map().begin()->second; | 1059 QuicSession* session = dispatcher->session_map().begin()->second; |
| 1060 EXPECT_EQ(kClientIFCW, | 1060 EXPECT_EQ(kClientIFCW, |
| 1061 session->config()->ReceivedInitialFlowControlWindowBytes()); | 1061 session->config()->ReceivedInitialFlowControlWindowBytes()); |
| 1062 server_thread_->Resume(); | 1062 server_thread_->Resume(); |
| 1063 } | 1063 } |
| 1064 | 1064 |
| 1065 } // namespace | 1065 } // namespace |
| 1066 } // namespace test | 1066 } // namespace test |
| 1067 } // namespace tools | 1067 } // namespace tools |
| 1068 } // namespace net | 1068 } // namespace net |
| OLD | NEW |