summaryrefslogtreecommitdiffstats
path: root/net/http/http_auth_handler_mock.h
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 21:51:14 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 21:51:14 +0000
commitc871bce9392dbf053c1cc73e22a2ef6f811fa412 (patch)
tree5066b447c29b9266d9c4760c5b5de1323f5d44cc /net/http/http_auth_handler_mock.h
parentc4bfb4f11dba0d48ae808c2b3fd023ed9f7a029b (diff)
downloadchromium_src-c871bce9392dbf053c1cc73e22a2ef6f811fa412.zip
chromium_src-c871bce9392dbf053c1cc73e22a2ef6f811fa412.tar.gz
chromium_src-c871bce9392dbf053c1cc73e22a2ef6f811fa412.tar.bz2
On multi-round authentication schemes, the info_ field in the HttpAuthController should be cleared (the user should only be prompted for username/password on the first round).
BUG=48752 TEST=net_unittests --gtest_filter="*MultiRoundAuth*" Review URL: http://codereview.chromium.org/2941006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_mock.h')
-rw-r--r--net/http/http_auth_handler_mock.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/http/http_auth_handler_mock.h b/net/http/http_auth_handler_mock.h
index 4a7fa22..a0ef4f0 100644
--- a/net/http/http_auth_handler_mock.h
+++ b/net/http/http_auth_handler_mock.h
@@ -5,6 +5,8 @@
#ifndef NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_
#define NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_
+#include <string>
+
#include "base/task.h"
#include "net/http/http_auth_handler.h"
#include "net/http/http_auth_handler_factory.h"
@@ -33,8 +35,15 @@ class HttpAuthHandlerMock : public HttpAuthHandler {
virtual int ResolveCanonicalName(HostResolver* host_resolver,
CompletionCallback* callback);
+ virtual bool NeedsIdentity() { return first_round_; }
+ virtual bool IsFinalRound() { return false; }
+
void SetGenerateExpectation(bool async, int rv);
+ void set_connection_based(bool connection_based) {
+ connection_based_ = connection_based;
+ }
+
// The Factory class simply returns the same handler each time
// CreateAuthHandler is called.
class Factory : public HttpAuthHandlerFactory {
@@ -76,6 +85,8 @@ class HttpAuthHandlerMock : public HttpAuthHandler {
bool generate_async_;
int generate_rv_;
std::string* auth_token_;
+ bool first_round_;
+ bool connection_based_;
};
} // namespace net