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

Unified Diff: net/http/http_stream_factory_impl_request_unittest.cc

Issue 2910463004: Revert "Revert CLs landed in HttpStreamFactoryImpl to track down a crasher" (Closed)
Patch Set: rebased Created 3 years, 6 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
Index: net/http/http_stream_factory_impl_request_unittest.cc
diff --git a/net/http/http_stream_factory_impl_request_unittest.cc b/net/http/http_stream_factory_impl_request_unittest.cc
index b455634518ced92c73cd06994a4177d2d7fc07c8..e8502768c0803c816eb20257cc20105d743c9f3f 100644
--- a/net/http/http_stream_factory_impl_request_unittest.cc
+++ b/net/http/http_stream_factory_impl_request_unittest.cc
@@ -26,7 +26,13 @@ class HttpStreamFactoryImplRequestTest : public ::testing::Test {};
// Make sure that Request passes on its priority updates to its jobs.
TEST_F(HttpStreamFactoryImplRequestTest, SetPriority) {
+ SequencedSocketData data(nullptr, 0, nullptr, 0);
+ data.set_connect_data(MockConnect(ASYNC, OK));
+ auto ssl_data = base::MakeUnique<SSLSocketDataProvider>(ASYNC, OK);
SpdySessionDependencies session_deps(ProxyService::CreateDirect());
+ session_deps.socket_factory->AddSocketDataProvider(&data);
+ session_deps.socket_factory->AddSSLSocketDataProvider(ssl_data.get());
+
std::unique_ptr<HttpNetworkSession> session =
SpdySessionDependencies::SpdyCreateSession(&session_deps);
HttpStreamFactoryImpl* factory =
@@ -34,20 +40,20 @@ TEST_F(HttpStreamFactoryImplRequestTest, SetPriority) {
MockHttpStreamRequestDelegate request_delegate;
TestJobFactory job_factory;
HttpRequestInfo request_info;
+ request_info.url = GURL("http://www.example.com/");
auto job_controller = base::MakeUnique<HttpStreamFactoryImpl::JobController>(
factory, &request_delegate, session.get(), &job_factory, request_info,
/* is_preconnect = */ false,
/* enable_ip_based_pooling = */ true,
- /* enable_alternative_services = */ true);
+ /* enable_alternative_services = */ true, SSLConfig(), SSLConfig());
HttpStreamFactoryImpl::JobController* job_controller_raw_ptr =
job_controller.get();
factory->job_controller_set_.insert(std::move(job_controller));
std::unique_ptr<HttpStreamFactoryImpl::Request> request(
job_controller_raw_ptr->Start(
- request_info, &request_delegate, nullptr, NetLogWithSource(),
- HttpStreamRequest::HTTP_STREAM, DEFAULT_PRIORITY, SSLConfig(),
- SSLConfig()));
+ &request_delegate, nullptr, NetLogWithSource(),
+ HttpStreamRequest::HTTP_STREAM, DEFAULT_PRIORITY));
EXPECT_TRUE(job_controller_raw_ptr->main_job());
EXPECT_EQ(DEFAULT_PRIORITY, job_controller_raw_ptr->main_job()->priority());
@@ -60,5 +66,7 @@ TEST_F(HttpStreamFactoryImplRequestTest, SetPriority) {
request->SetPriority(IDLE);
EXPECT_EQ(IDLE, job_controller_raw_ptr->main_job()->priority());
+ EXPECT_TRUE(data.AllReadDataConsumed());
+ EXPECT_TRUE(data.AllWriteDataConsumed());
}
} // namespace net
« no previous file with comments | « net/http/http_stream_factory_impl_job_controller_unittest.cc ('k') | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698