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 10 matching lines...) Expand all Loading... |
21 HttpStreamFactoryImplRequestTest, | 21 HttpStreamFactoryImplRequestTest, |
22 testing::Values(kProtoDeprecatedSPDY2, | 22 testing::Values(kProtoDeprecatedSPDY2, |
23 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4)); | 23 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4)); |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 class DoNothingRequestDelegate : public HttpStreamRequest::Delegate { | 27 class DoNothingRequestDelegate : public HttpStreamRequest::Delegate { |
28 public: | 28 public: |
29 DoNothingRequestDelegate() {} | 29 DoNothingRequestDelegate() {} |
30 | 30 |
31 virtual ~DoNothingRequestDelegate() {} | 31 ~DoNothingRequestDelegate() override {} |
32 | 32 |
33 // HttpStreamRequest::Delegate | 33 // HttpStreamRequest::Delegate |
34 virtual void OnStreamReady( | 34 void OnStreamReady(const SSLConfig& used_ssl_config, |
35 const SSLConfig& used_ssl_config, | 35 const ProxyInfo& used_proxy_info, |
36 const ProxyInfo& used_proxy_info, | 36 HttpStreamBase* stream) override {} |
37 HttpStreamBase* stream) override {} | 37 void OnWebSocketHandshakeStreamReady( |
38 virtual void OnWebSocketHandshakeStreamReady( | |
39 const SSLConfig& used_ssl_config, | 38 const SSLConfig& used_ssl_config, |
40 const ProxyInfo& used_proxy_info, | 39 const ProxyInfo& used_proxy_info, |
41 WebSocketHandshakeStreamBase* stream) override {} | 40 WebSocketHandshakeStreamBase* stream) override {} |
42 virtual void OnStreamFailed( | 41 void OnStreamFailed(int status, const SSLConfig& used_ssl_config) override {} |
43 int status, | 42 void OnCertificateError(int status, |
44 const SSLConfig& used_ssl_config) override {} | 43 const SSLConfig& used_ssl_config, |
45 virtual void OnCertificateError( | 44 const SSLInfo& ssl_info) override {} |
46 int status, | 45 void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response, |
47 const SSLConfig& used_ssl_config, | 46 const SSLConfig& used_ssl_config, |
48 const SSLInfo& ssl_info) override {} | 47 const ProxyInfo& used_proxy_info, |
49 virtual void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response, | 48 HttpAuthController* auth_controller) override {} |
50 const SSLConfig& used_ssl_config, | 49 void OnNeedsClientAuth(const SSLConfig& used_ssl_config, |
51 const ProxyInfo& used_proxy_info, | 50 SSLCertRequestInfo* cert_info) override {} |
52 HttpAuthController* auth_controller) override {} | 51 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, |
53 virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config, | 52 const SSLConfig& used_ssl_config, |
54 SSLCertRequestInfo* cert_info) override {} | 53 const ProxyInfo& used_proxy_info, |
55 virtual void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, | 54 HttpStreamBase* stream) override {} |
56 const SSLConfig& used_ssl_config, | |
57 const ProxyInfo& used_proxy_info, | |
58 HttpStreamBase* stream) override {} | |
59 }; | 55 }; |
60 | 56 |
61 } // namespace | 57 } // namespace |
62 | 58 |
63 // Make sure that Request passes on its priority updates to its jobs. | 59 // Make sure that Request passes on its priority updates to its jobs. |
64 TEST_P(HttpStreamFactoryImplRequestTest, SetPriority) { | 60 TEST_P(HttpStreamFactoryImplRequestTest, SetPriority) { |
65 SpdySessionDependencies session_deps(GetParam(), | 61 SpdySessionDependencies session_deps(GetParam(), |
66 ProxyService::CreateDirect()); | 62 ProxyService::CreateDirect()); |
67 | 63 |
68 scoped_refptr<HttpNetworkSession> | 64 scoped_refptr<HttpNetworkSession> |
(...skipping 20 matching lines...) Expand all Loading... |
89 EXPECT_EQ(MEDIUM, job->priority()); | 85 EXPECT_EQ(MEDIUM, job->priority()); |
90 | 86 |
91 // Make |job| the bound job. | 87 // Make |job| the bound job. |
92 request.OnStreamFailed(job, ERR_FAILED, SSLConfig()); | 88 request.OnStreamFailed(job, ERR_FAILED, SSLConfig()); |
93 | 89 |
94 request.SetPriority(IDLE); | 90 request.SetPriority(IDLE); |
95 EXPECT_EQ(IDLE, job->priority()); | 91 EXPECT_EQ(IDLE, job->priority()); |
96 } | 92 } |
97 | 93 |
98 } // namespace net | 94 } // namespace net |
OLD | NEW |