OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/http/http_auth_cache.h" | 12 #include "net/http/http_auth_cache.h" |
13 #include "net/http/http_auth_handler.h" | 13 #include "net/http/http_auth_handler.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using base::ASCIIToUTF16; | 16 using base::ASCIIToUTF16; |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 class MockAuthHandler : public HttpAuthHandler { | 22 class MockAuthHandler : public HttpAuthHandler { |
23 public: | 23 public: |
24 MockAuthHandler(const std::string& scheme, | 24 MockAuthHandler(const std::string& scheme, |
25 const std::string& realm, | 25 const std::string& realm, |
26 HttpAuth::Target target) { | 26 HttpAuth::Target target) |
| 27 : HttpAuthHandler(scheme) { |
27 // Can't use initializer list since these are members of the base class. | 28 // Can't use initializer list since these are members of the base class. |
28 auth_scheme_ = scheme; | |
29 realm_ = realm; | 29 realm_ = realm; |
30 target_ = target; | 30 target_ = target; |
31 } | 31 } |
32 | 32 |
33 HttpAuth::AuthorizationResult HandleAnotherChallenge( | 33 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
34 const HttpAuthChallengeTokenizer& challenge) override { | 34 const HttpAuthChallengeTokenizer& challenge) override { |
35 return HttpAuth::AUTHORIZATION_RESULT_REJECT; | 35 return HttpAuth::AUTHORIZATION_RESULT_REJECT; |
36 } | 36 } |
37 | 37 |
38 protected: | 38 protected: |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 CheckPathExistence(0, i, false); | 575 CheckPathExistence(0, i, false); |
576 | 576 |
577 for (int i = 0; i < kMaxPaths; ++i) | 577 for (int i = 0; i < kMaxPaths; ++i) |
578 CheckPathExistence(0, i + 3, true); | 578 CheckPathExistence(0, i + 3, true); |
579 | 579 |
580 for (int i = 0; i < kMaxRealms; ++i) | 580 for (int i = 0; i < kMaxRealms; ++i) |
581 CheckRealmExistence(i, true); | 581 CheckRealmExistence(i, true); |
582 } | 582 } |
583 | 583 |
584 } // namespace net | 584 } // namespace net |
OLD | NEW |