| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/string16.h" | 7 #include "base/string16.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/http/http_auth_cache.h" | 11 #include "net/http/http_auth_cache.h" |
| 12 #include "net/http/http_auth_handler.h" | 12 #include "net/http/http_auth_handler.h" |
| 13 | |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 14 |
| 16 namespace net { | 15 namespace net { |
| 17 | 16 |
| 18 namespace { | 17 namespace { |
| 19 | 18 |
| 20 class MockAuthHandler : public HttpAuthHandler { | 19 class MockAuthHandler : public HttpAuthHandler { |
| 21 public: | 20 public: |
| 22 MockAuthHandler(const char* scheme, const std::string& realm, | 21 MockAuthHandler(const char* scheme, const std::string& realm, |
| 23 HttpAuth::Target target) { | 22 HttpAuth::Target target) { |
| 24 // Can't use initializer list since these are members of the base class. | 23 // Can't use initializer list since these are members of the base class. |
| 25 scheme_ = scheme; | 24 scheme_ = scheme; |
| 26 realm_ = realm; | 25 realm_ = realm; |
| 27 score_ = 1; | 26 score_ = 1; |
| 28 target_ = target; | 27 target_ = target; |
| 29 properties_ = 0; | 28 properties_ = 0; |
| 30 } | 29 } |
| 31 | 30 |
| 31 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 32 HttpAuth::ChallengeTokenizer* challenge) { |
| 33 return HttpAuth::AUTHORIZATION_RESULT_REJECT; |
| 34 } |
| 35 |
| 32 protected: | 36 protected: |
| 33 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge) { | 37 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge) { |
| 34 return false; // Unused. | 38 return false; // Unused. |
| 35 } | 39 } |
| 36 | 40 |
| 37 virtual int GenerateAuthTokenImpl(const string16*, | 41 virtual int GenerateAuthTokenImpl(const string16*, |
| 38 const string16*, | 42 const string16*, |
| 39 const HttpRequestInfo*, | 43 const HttpRequestInfo*, |
| 40 CompletionCallback* callback, | 44 CompletionCallback* callback, |
| 41 std::string* auth_token) { | 45 std::string* auth_token) { |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 CheckPathExistence(0, i, false); | 412 CheckPathExistence(0, i, false); |
| 409 | 413 |
| 410 for (int i = 0; i < kMaxPaths; ++i) | 414 for (int i = 0; i < kMaxPaths; ++i) |
| 411 CheckPathExistence(0, i + 3, true); | 415 CheckPathExistence(0, i + 3, true); |
| 412 | 416 |
| 413 for (int i = 0; i < kMaxRealms; ++i) | 417 for (int i = 0; i < kMaxRealms; ++i) |
| 414 CheckRealmExistence(i, true); | 418 CheckRealmExistence(i, true); |
| 415 } | 419 } |
| 416 | 420 |
| 417 } // namespace net | 421 } // namespace net |
| OLD | NEW |