Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: net/http/bidirectional_stream_unittest.cc

Issue 1992953004: [Cronet] Make delaying sending request headers explicit in bidirectional stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: correct a typo Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/bidirectional_stream_impl.h ('k') | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/bidirectional_stream_unittest.cc
diff --git a/net/http/bidirectional_stream_unittest.cc b/net/http/bidirectional_stream_unittest.cc
index 9fa41cf62a693e7c8fefe236761cbe22cf2461eb..77c175a195bd3f78e2d68f0e914131bb11f83f31 100644
--- a/net/http/bidirectional_stream_unittest.cc
+++ b/net/http/bidirectional_stream_unittest.cc
@@ -58,12 +58,15 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
on_data_sent_count_(0),
do_not_start_read_(false),
run_until_completion_(false),
- not_expect_callback_(false),
- disable_auto_flush_(false) {}
+ not_expect_callback_(false) {}
~TestDelegateBase() override {}
- void OnStreamReady() override {
+ void OnStreamReady(bool request_headers_sent) override {
+ // Request headers should always be sent in H2's case, because the
+ // functionality to combine header frame with data frames is not
+ // implemented.
+ EXPECT_TRUE(request_headers_sent);
if (callback_.is_null())
return;
callback_.Run(OK);
@@ -111,12 +114,10 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
loop_->Quit();
}
- void DisableAutoFlush() { disable_auto_flush_ = true; }
-
void Start(std::unique_ptr<BidirectionalStreamRequestInfo> request_info,
HttpNetworkSession* session) {
stream_.reset(new BidirectionalStream(std::move(request_info), session,
- false, this, std::move(timer_)));
+ true, this, std::move(timer_)));
if (run_until_completion_)
loop_->Run();
}
@@ -126,8 +127,7 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
const CompletionCallback& cb) {
callback_ = cb;
stream_.reset(new BidirectionalStream(std::move(request_info), session,
- disable_auto_flush_, this,
- std::move(timer_)));
+ true, this, std::move(timer_)));
if (run_until_completion_)
loop_->Run();
}
@@ -222,7 +222,6 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
// This is to ensure that delegate callback is not invoked synchronously when
// calling into |stream_|.
bool not_expect_callback_;
- bool disable_auto_flush_;
CompletionCallback callback_;
DISALLOW_COPY_AND_ASSIGN(TestDelegateBase);
@@ -759,7 +758,6 @@ TEST_F(BidirectionalStreamTest, TestCoalesceSmallDataBuffers) {
std::unique_ptr<TestDelegateBase> delegate(new TestDelegateBase(
read_buffer.get(), kReadBufferSize, base::WrapUnique(timer)));
delegate->set_do_not_start_read(true);
- delegate->DisableAutoFlush();
TestCompletionCallback callback;
delegate->Start(std::move(request_info), http_session_.get(),
callback.callback());
« no previous file with comments | « net/http/bidirectional_stream_impl.h ('k') | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698