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

Side by Side Diff: net/http/http_auth_handler_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_handler_ntlm_win.cc ('k') | net/http/http_auth_multi_round_parse.h » ('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) 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/http/http_auth_handler.h" 5 #include "net/http/http_auth_handler.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 25 matching lines...) Expand all
36 (k == 0) ? HttpAuth::AUTH_PROXY : HttpAuth::AUTH_SERVER; 36 (k == 0) ? HttpAuth::AUTH_PROXY : HttpAuth::AUTH_SERVER;
37 NetLog::EventType event_type = 37 NetLog::EventType event_type =
38 (k == 0) ? NetLog::TYPE_AUTH_PROXY : NetLog::TYPE_AUTH_SERVER; 38 (k == 0) ? NetLog::TYPE_AUTH_PROXY : NetLog::TYPE_AUTH_SERVER;
39 HttpAuthChallengeTokenizer tokenizer( 39 HttpAuthChallengeTokenizer tokenizer(
40 challenge.begin(), challenge.end()); 40 challenge.begin(), challenge.end());
41 HttpAuthHandlerMock mock_handler; 41 HttpAuthHandlerMock mock_handler;
42 TestNetLog test_net_log; 42 TestNetLog test_net_log;
43 BoundNetLog bound_net_log( 43 BoundNetLog bound_net_log(
44 BoundNetLog::Make(&test_net_log, NetLog::SOURCE_NONE)); 44 BoundNetLog::Make(&test_net_log, NetLog::SOURCE_NONE));
45 45
46 mock_handler.InitFromChallenge(&tokenizer, target, 46 mock_handler.HandleInitialChallenge(tokenizer, target, origin,
47 origin, bound_net_log); 47 bound_net_log);
48 mock_handler.SetGenerateExpectation(async, rv); 48 mock_handler.SetGenerateExpectation(async, rv);
49 mock_handler.GenerateAuthToken(&credentials, &request, 49 mock_handler.GenerateAuthToken(&credentials, request,
50 test_callback.callback(), &auth_token); 50 test_callback.callback(), &auth_token);
51 if (async) 51 if (async)
52 test_callback.WaitForResult(); 52 test_callback.WaitForResult();
53 53
54 TestNetLogEntry::List entries; 54 TestNetLogEntry::List entries;
55 test_net_log.GetEntries(&entries); 55 test_net_log.GetEntries(&entries);
56 56
57 EXPECT_EQ(2u, entries.size()); 57 EXPECT_EQ(2u, entries.size());
58 EXPECT_TRUE(LogContainsBeginEvent(entries, 0, event_type)); 58 EXPECT_TRUE(LogContainsBeginEvent(entries, 0, event_type));
59 EXPECT_TRUE(LogContainsEndEvent(entries, 1, event_type)); 59 EXPECT_TRUE(LogContainsEndEvent(entries, 1, event_type));
60 } 60 }
61 } 61 }
62 } 62 }
63 } 63 }
64 64
65 } // namespace net 65 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_ntlm_win.cc ('k') | net/http/http_auth_multi_round_parse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698