| 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 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 string request_string = | 1714 string request_string = |
| 1715 "a request body bigger than one packet" + string(kMaxPacketSize, '.'); | 1715 "a request body bigger than one packet" + string(kMaxPacketSize, '.'); |
| 1716 | 1716 |
| 1717 // Send the request, and register the delegate for ACKs. | 1717 // Send the request, and register the delegate for ACKs. |
| 1718 client_->SendData(request_string, true, delegate.get()); | 1718 client_->SendData(request_string, true, delegate.get()); |
| 1719 client_->WaitForResponse(); | 1719 client_->WaitForResponse(); |
| 1720 EXPECT_EQ(kFooResponseBody, client_->response_body()); | 1720 EXPECT_EQ(kFooResponseBody, client_->response_body()); |
| 1721 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); | 1721 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); |
| 1722 | 1722 |
| 1723 // Send another request to flush out any pending ACKs on the server. | 1723 // Send another request to flush out any pending ACKs on the server. |
| 1724 client_->SendSynchronousRequest(request_string); | 1724 client_->SendSynchronousRequest("/bar"); |
| 1725 | 1725 |
| 1726 // Pause the server to avoid races. | 1726 // Pause the server to avoid races. |
| 1727 server_thread_->Pause(); | 1727 server_thread_->Pause(); |
| 1728 // Make sure the delegate does get the notification it expects. | 1728 // Make sure the delegate does get the notification it expects. |
| 1729 while (!delegate->has_been_notified()) { | 1729 while (!delegate->has_been_notified()) { |
| 1730 // Waits for up to 50 ms. | 1730 // Waits for up to 50 ms. |
| 1731 client_->client()->WaitForEvents(); | 1731 client_->client()->WaitForEvents(); |
| 1732 } | 1732 } |
| 1733 server_thread_->Resume(); | 1733 server_thread_->Resume(); |
| 1734 } | 1734 } |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 // There will be buffered data to write in the client's stream. | 2109 // There will be buffered data to write in the client's stream. |
| 2110 ReliableQuicStream* stream = client_->client()->session()->GetStream(5); | 2110 ReliableQuicStream* stream = client_->client()->session()->GetStream(5); |
| 2111 EXPECT_TRUE(stream != nullptr && stream->HasBufferedData()); | 2111 EXPECT_TRUE(stream != nullptr && stream->HasBufferedData()); |
| 2112 } | 2112 } |
| 2113 } | 2113 } |
| 2114 | 2114 |
| 2115 } // namespace | 2115 } // namespace |
| 2116 } // namespace test | 2116 } // namespace test |
| 2117 } // namespace tools | 2117 } // namespace tools |
| 2118 } // namespace net | 2118 } // namespace net |
| OLD | NEW |