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 <sys/epoll.h> | 6 #include <sys/epoll.h> |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <list> | 9 #include <list> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 // Create a POST request and send the headers only. | 1967 // Create a POST request and send the headers only. |
1968 SpdyHeaderBlock headers; | 1968 SpdyHeaderBlock headers; |
1969 headers[":method"] = "POST"; | 1969 headers[":method"] = "POST"; |
1970 headers[":path"] = "/foo"; | 1970 headers[":path"] = "/foo"; |
1971 headers[":scheme"] = "https"; | 1971 headers[":scheme"] = "https"; |
1972 headers[":authority"] = server_hostname_; | 1972 headers[":authority"] = server_hostname_; |
1973 | 1973 |
1974 client_->SendMessage(headers, "", /*fin=*/false); | 1974 client_->SendMessage(headers, "", /*fin=*/false); |
1975 | 1975 |
1976 // The TestAckListener will cause a failure if not notified. | 1976 // The TestAckListener will cause a failure if not notified. |
1977 scoped_refptr<TestAckListener> delegate(new TestAckListener(2)); | 1977 QuicReferenceCountedPointer<TestAckListener> delegate(new TestAckListener(2)); |
1978 | 1978 |
1979 // Test the AckNotifier's ability to track multiple packets by making the | 1979 // Test the AckNotifier's ability to track multiple packets by making the |
1980 // request body exceed the size of a single packet. | 1980 // request body exceed the size of a single packet. |
1981 string request_string = | 1981 string request_string = |
1982 "a request body bigger than one packet" + string(kMaxPacketSize, '.'); | 1982 "a request body bigger than one packet" + string(kMaxPacketSize, '.'); |
1983 | 1983 |
1984 // Send the request, and register the delegate for ACKs. | 1984 // Send the request, and register the delegate for ACKs. |
1985 client_->SendData(request_string, true, delegate); | 1985 client_->SendData(request_string, true, delegate); |
1986 client_->WaitForResponse(); | 1986 client_->WaitForResponse(); |
1987 EXPECT_EQ(kFooResponseBody, client_->response_body()); | 1987 EXPECT_EQ(kFooResponseBody, client_->response_body()); |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3047 client_->WaitForResponse(); | 3047 client_->WaitForResponse(); |
3048 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 3048 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
3049 QuicConnectionStats client_stats = | 3049 QuicConnectionStats client_stats = |
3050 client_->client()->session()->connection()->GetStats(); | 3050 client_->client()->session()->connection()->GetStats(); |
3051 EXPECT_EQ(0u, client_stats.packets_lost); | 3051 EXPECT_EQ(0u, client_stats.packets_lost); |
3052 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 3052 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
3053 } | 3053 } |
3054 } // namespace | 3054 } // namespace |
3055 } // namespace test | 3055 } // namespace test |
3056 } // namespace net | 3056 } // namespace net |
OLD | NEW |