| 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 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2146 // (This is OK despite already waiting for a response.) | 2146 // (This is OK despite already waiting for a response.) |
| 2147 client_->WaitForResponse(); | 2147 client_->WaitForResponse(); |
| 2148 // There should be no buffered data to write in the client's stream. | 2148 // There should be no buffered data to write in the client's stream. |
| 2149 ReliableQuicStream* stream = | 2149 ReliableQuicStream* stream = |
| 2150 client_->client()->session()->GetStream(kClientDataStreamId1); | 2150 client_->client()->session()->GetStream(kClientDataStreamId1); |
| 2151 EXPECT_FALSE(stream != nullptr && stream->HasBufferedData()); | 2151 EXPECT_FALSE(stream != nullptr && stream->HasBufferedData()); |
| 2152 } | 2152 } |
| 2153 | 2153 |
| 2154 TEST_P(EndToEndTest, Trailers) { | 2154 TEST_P(EndToEndTest, Trailers) { |
| 2155 // Test sending and receiving HTTP/2 Trailers (trailing HEADERS frames). | 2155 // Test sending and receiving HTTP/2 Trailers (trailing HEADERS frames). |
| 2156 ValueRestore<bool> old_flag(&FLAGS_quic_supports_trailers, true); | |
| 2157 ASSERT_TRUE(Initialize()); | 2156 ASSERT_TRUE(Initialize()); |
| 2158 client_->client()->WaitForCryptoHandshakeConfirmed(); | 2157 client_->client()->WaitForCryptoHandshakeConfirmed(); |
| 2159 | 2158 |
| 2160 // Set reordering to ensure that Trailers arriving before body is ok. | 2159 // Set reordering to ensure that Trailers arriving before body is ok. |
| 2161 SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2)); | 2160 SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2)); |
| 2162 SetReorderPercentage(30); | 2161 SetReorderPercentage(30); |
| 2163 | 2162 |
| 2164 // Add a response with headers, body, and trailers. | 2163 // Add a response with headers, body, and trailers. |
| 2165 const string kBody = "body content"; | 2164 const string kBody = "body content"; |
| 2166 | 2165 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2426 // sending requests for them. | 2425 // sending requests for them. |
| 2427 EXPECT_EQ(1u, client_->num_requests()); | 2426 EXPECT_EQ(1u, client_->num_requests()); |
| 2428 // Including response to original request, 12 responses in total were | 2427 // Including response to original request, 12 responses in total were |
| 2429 // recieved. | 2428 // recieved. |
| 2430 EXPECT_EQ(12u, client_->num_responses()); | 2429 EXPECT_EQ(12u, client_->num_responses()); |
| 2431 } | 2430 } |
| 2432 | 2431 |
| 2433 } // namespace | 2432 } // namespace |
| 2434 } // namespace test | 2433 } // namespace test |
| 2435 } // namespace net | 2434 } // namespace net |
| OLD | NEW |