OLD | NEW |
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 "net/http/http_stream_factory_impl_job.h" | 7 #include "net/http/http_stream_factory_impl_job.h" |
8 #include "net/proxy/proxy_info.h" | 8 #include "net/proxy/proxy_info.h" |
9 #include "net/proxy/proxy_service.h" | 9 #include "net/proxy/proxy_service.h" |
10 #include "net/spdy/spdy_test_util_common.h" | 10 #include "net/spdy/spdy_test_util_common.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 scoped_refptr<HttpNetworkSession> | 63 scoped_refptr<HttpNetworkSession> |
64 session(SpdySessionDependencies::SpdyCreateSession(&session_deps)); | 64 session(SpdySessionDependencies::SpdyCreateSession(&session_deps)); |
65 HttpStreamFactoryImpl* factory = | 65 HttpStreamFactoryImpl* factory = |
66 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); | 66 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); |
67 | 67 |
68 DoNothingRequestDelegate request_delegate; | 68 DoNothingRequestDelegate request_delegate; |
69 HttpStreamFactoryImpl::Request request( | 69 HttpStreamFactoryImpl::Request request( |
70 GURL(), factory, &request_delegate, NULL, BoundNetLog()); | 70 GURL(), factory, &request_delegate, NULL, BoundNetLog()); |
71 | 71 |
72 HttpStreamFactoryImpl::Job* job = | 72 AlternateProtocolInfo alternate_protocol; |
73 new HttpStreamFactoryImpl::Job(factory, | 73 HttpStreamFactoryImpl::Job* job = new HttpStreamFactoryImpl::Job( |
74 session.get(), | 74 factory, session.get(), HttpRequestInfo(), DEFAULT_PRIORITY, SSLConfig(), |
75 HttpRequestInfo(), | 75 SSLConfig(), NULL, alternate_protocol); |
76 DEFAULT_PRIORITY, | |
77 SSLConfig(), | |
78 SSLConfig(), | |
79 NULL); | |
80 request.AttachJob(job); | 76 request.AttachJob(job); |
81 EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); | 77 EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); |
82 | 78 |
83 request.SetPriority(MEDIUM); | 79 request.SetPriority(MEDIUM); |
84 EXPECT_EQ(MEDIUM, job->priority()); | 80 EXPECT_EQ(MEDIUM, job->priority()); |
85 | 81 |
86 // Make |job| the bound job. | 82 // Make |job| the bound job. |
87 request.OnStreamFailed(job, ERR_FAILED, SSLConfig()); | 83 request.OnStreamFailed(job, ERR_FAILED, SSLConfig()); |
88 | 84 |
89 request.SetPriority(IDLE); | 85 request.SetPriority(IDLE); |
90 EXPECT_EQ(IDLE, job->priority()); | 86 EXPECT_EQ(IDLE, job->priority()); |
91 } | 87 } |
92 | 88 |
93 } // namespace net | 89 } // namespace net |
OLD | NEW |