Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: net/http/http_auth_cache_unittest.cc

Issue 1383613002: [net/http auth] Cleanup. Method names, and constness. Base URL: https://chromium.googlesource.com/chromium/src.git@mock-auth-handler-generalization
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_auth.cc ('k') | net/http/http_auth_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 13 matching lines...) Expand all
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 // Can't use initializer list since these are members of the base class. 27 // Can't use initializer list since these are members of the base class.
28 auth_scheme_ = scheme; 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 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:
39 bool Init(HttpAuthChallengeTokenizer* challenge) override { 39 int Init(const HttpAuthChallengeTokenizer& challenge) override {
40 return false; // Unused. 40 return ERR_UNEXPECTED; // Unused.
41 } 41 }
42 42
43 int GenerateAuthTokenImpl(const AuthCredentials*, 43 int GenerateAuthTokenImpl(const AuthCredentials*,
44 const HttpRequestInfo*, 44 const HttpRequestInfo&,
45 const CompletionCallback& callback, 45 const CompletionCallback& callback,
46 std::string* auth_token) override { 46 std::string* auth_token) override {
47 *auth_token = "mock-credentials"; 47 *auth_token = "mock-credentials";
48 return OK; 48 return OK;
49 } 49 }
50 50
51 51
52 private: 52 private:
53 ~MockAuthHandler() override {} 53 ~MockAuthHandler() override {}
54 }; 54 };
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « net/http/http_auth.cc ('k') | net/http/http_auth_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698