OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/url_request/url_request_context_builder.h" | 5 #include "net/url_request/url_request_context_builder.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "net/base/request_priority.h" | 9 #include "net/base/request_priority.h" |
10 #include "net/http/http_auth_handler.h" | 10 #include "net/http/http_auth_handler.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 namespace net { | 23 namespace net { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 class MockHttpAuthHandlerFactory : public HttpAuthHandlerFactory { | 27 class MockHttpAuthHandlerFactory : public HttpAuthHandlerFactory { |
28 public: | 28 public: |
29 explicit MockHttpAuthHandlerFactory(int return_code) : | 29 explicit MockHttpAuthHandlerFactory(int return_code) : |
30 return_code_(return_code) {} | 30 return_code_(return_code) {} |
31 ~MockHttpAuthHandlerFactory() override {} | 31 ~MockHttpAuthHandlerFactory() override {} |
32 | 32 |
33 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 33 int CreateAuthHandler(const HttpAuthChallengeTokenizer& challenge, |
34 HttpAuth::Target target, | 34 HttpAuth::Target target, |
35 const GURL& origin, | 35 const GURL& origin, |
36 CreateReason reason, | 36 CreateReason reason, |
37 int nonce_count, | 37 int nonce_count, |
38 const BoundNetLog& net_log, | 38 const BoundNetLog& net_log, |
39 scoped_ptr<HttpAuthHandler>* handler) override { | 39 scoped_ptr<HttpAuthHandler>* handler) override { |
40 handler->reset(); | 40 handler->reset(); |
41 return return_code_; | 41 return return_code_; |
42 } | 42 } |
43 | 43 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 &handler)); | 109 &handler)); |
110 // Verify that a handler isn't returned for a bogus scheme. | 110 // Verify that a handler isn't returned for a bogus scheme. |
111 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, | 111 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, |
112 context->http_auth_handler_factory()->CreateAuthHandlerFromString( | 112 context->http_auth_handler_factory()->CreateAuthHandlerFromString( |
113 "Bogus", HttpAuth::AUTH_SERVER, gurl, BoundNetLog(), &handler)); | 113 "Bogus", HttpAuth::AUTH_SERVER, gurl, BoundNetLog(), &handler)); |
114 } | 114 } |
115 | 115 |
116 } // namespace | 116 } // namespace |
117 | 117 |
118 } // namespace net | 118 } // namespace net |
OLD | NEW |