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

Side by Side Diff: net/http/http_stream_factory_impl_request_unittest.cc

Issue 1540463003: Change the interface of GetAlternativeServicesFor, always return the best Alt-Svc entry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change hanging_data_ to vector Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/http/http_stream_factory_impl_request.h" 5 #include "net/http/http_stream_factory_impl_request.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "net/http/http_stream_factory_impl_job.h" 8 #include "net/http/http_stream_factory_impl_job.h"
9 #include "net/proxy/proxy_info.h" 9 #include "net/proxy/proxy_info.h"
10 #include "net/proxy/proxy_service.h" 10 #include "net/proxy/proxy_service.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 scoped_ptr<HttpNetworkSession> session = 73 scoped_ptr<HttpNetworkSession> session =
74 SpdySessionDependencies::SpdyCreateSession(&session_deps); 74 SpdySessionDependencies::SpdyCreateSession(&session_deps);
75 HttpStreamFactoryImpl* factory = 75 HttpStreamFactoryImpl* factory =
76 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); 76 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory());
77 77
78 DoNothingRequestDelegate request_delegate; 78 DoNothingRequestDelegate request_delegate;
79 HttpStreamFactoryImpl::Request request( 79 HttpStreamFactoryImpl::Request request(
80 GURL(), factory, &request_delegate, NULL, BoundNetLog(), 80 GURL(), factory, &request_delegate, NULL, BoundNetLog(),
81 HttpStreamFactoryImpl::Request::HTTP_STREAM); 81 HttpStreamFactoryImpl::Request::HTTP_STREAM);
82 82
83 HttpStreamFactoryImpl::Job* job = 83 HttpRequestInfo request_info;
84 new HttpStreamFactoryImpl::Job(factory, 84
85 session.get(), 85 HostPortPair server = HostPortPair::FromURL(request_info.url);
86 HttpRequestInfo(), 86 GURL original_url = factory->ApplyHostMappingRules(request_info.url, &server);
87 DEFAULT_PRIORITY, 87
88 SSLConfig(), 88 HttpStreamFactoryImpl::Job* job = new HttpStreamFactoryImpl::Job(
89 SSLConfig(), 89 factory, session.get(), request_info, DEFAULT_PRIORITY, SSLConfig(),
90 NULL); 90 SSLConfig(), server, original_url, NULL);
91 request.AttachJob(job); 91 request.AttachJob(job);
92 EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); 92 EXPECT_EQ(DEFAULT_PRIORITY, job->priority());
93 93
94 request.SetPriority(MEDIUM); 94 request.SetPriority(MEDIUM);
95 EXPECT_EQ(MEDIUM, job->priority()); 95 EXPECT_EQ(MEDIUM, job->priority());
96 96
97 // Make |job| the bound job. 97 // Make |job| the bound job.
98 request.OnStreamFailed(job, ERR_FAILED, SSLConfig(), SSL_FAILURE_NONE); 98 request.OnStreamFailed(job, ERR_FAILED, SSLConfig(), SSL_FAILURE_NONE);
99 99
100 request.SetPriority(IDLE); 100 request.SetPriority(IDLE);
101 EXPECT_EQ(IDLE, job->priority()); 101 EXPECT_EQ(IDLE, job->priority());
102 } 102 }
103 103
104 } // namespace net 104 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698