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

Unified Diff: net/http/http_auth_handler_mock.cc

Issue 7477055: Change HttpAuthHandlerMock to accept and return more than one (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: net/http/http_auth_handler_mock.cc
===================================================================
--- net/http/http_auth_handler_mock.cc (revision 95261)
+++ net/http/http_auth_handler_mock.cc (working copy)
@@ -142,10 +142,9 @@
HttpAuthHandlerMock::Factory::~Factory() {
}
-void HttpAuthHandlerMock::Factory::set_mock_handler(
+void HttpAuthHandlerMock::Factory::AddMockHandler(
HttpAuthHandler* handler, HttpAuth::Target target) {
- EXPECT_TRUE(handlers_[target].get() == NULL);
- handlers_[target].reset(handler);
+ handlers_[target].push_back(handler);
}
int HttpAuthHandlerMock::Factory::CreateAuthHandler(
@@ -156,9 +155,10 @@
int nonce_count,
const BoundNetLog& net_log,
scoped_ptr<HttpAuthHandler>* handler) {
- if (!handlers_[target].get())
+ if (handlers_[target].empty())
return ERR_UNEXPECTED;
- scoped_ptr<HttpAuthHandler> tmp_handler(handlers_[target].release());
+ scoped_ptr<HttpAuthHandler> tmp_handler(handlers_[target][0]);
cbentzel 2011/08/03 21:22:10 I'd add an alias to handlers_[target].get() here t
Ryan Hamilton 2011/08/03 22:03:37 Done.
+ handlers_[target].get().erase(handlers_[target].get().begin());
if (do_init_from_challenge_ &&
!tmp_handler->InitFromChallenge(challenge, target, origin, net_log))
return ERR_INVALID_RESPONSE;

Powered by Google App Engine
This is Rietveld 408576698