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

Unified Diff: net/socket/socket_test_util.h

Issue 3039028: Make HttpAuthController not reference counted. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « net/http/http_proxy_client_socket_pool_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.h
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index 2bd0d23863a0c9df15ba6f00123996dfe63f7285..9ccc11384c1332a4c6da7305e3dee4a1a89af0d3 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -694,14 +694,23 @@ class MockSOCKSClientSocketPool : public SOCKSClientSocketPool {
};
struct MockHttpAuthControllerData {
- MockHttpAuthControllerData(std::string header) : auth_header(header) {}
+ MockHttpAuthControllerData(std::string header,
+ std::string expected_username,
+ std::string expected_password)
+ : auth_header(header),
+ username(expected_username),
+ password(expected_password) {}
std::string auth_header;
+ std::string username;
+ std::string password;
};
class MockHttpAuthController : public HttpAuthController {
public:
MockHttpAuthController();
+ virtual ~MockHttpAuthController() {}
+
void SetMockAuthControllerData(struct MockHttpAuthControllerData* data,
size_t data_length);
@@ -715,13 +724,15 @@ class MockHttpAuthController : public HttpAuthController {
bool do_not_send_server_auth,
bool establishing_tunnel,
const BoundNetLog& net_log);
- virtual void ResetAuth(const std::wstring& username,
- const std::wstring& password);
+ virtual void SetCredentials(const std::wstring& username,
+ const std::wstring& password);
+ void PrepareForAuthRestart();
+
virtual bool HaveAuthHandler() const;
virtual bool HaveAuth() const;
+ virtual HttpAuth::Identity AuthIdentity();
private:
- virtual ~MockHttpAuthController() {}
const struct MockHttpAuthControllerData& CurrentData() const {
DCHECK(data_index_ < data_count_);
return data_[data_index_];
@@ -730,6 +741,7 @@ class MockHttpAuthController : public HttpAuthController {
MockHttpAuthControllerData* data_;
size_t data_index_;
size_t data_count_;
+ size_t next_index_;
};
// Constants for a successful SOCKS v5 handshake.
« no previous file with comments | « net/http/http_proxy_client_socket_pool_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698