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

Unified Diff: net/http/http_auth_handler_mock.h

Issue 2489883007: [net/auth] Discard current handler token generation fails. (Closed)
Patch Set: Missed a few comments in the last round. Created 4 years, 1 month 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_auth_controller.cc ('k') | net/http/http_auth_handler_mock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_mock.h
diff --git a/net/http/http_auth_handler_mock.h b/net/http/http_auth_handler_mock.h
index 049b880354038f0fe46e73727b5ea700a947edd9..6a1e58e8f2eaa80f6376eef6aec61de7bbcd3e7c 100644
--- a/net/http/http_auth_handler_mock.h
+++ b/net/http/http_auth_handler_mock.h
@@ -6,6 +6,7 @@
#define NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_
#include <memory>
+#include <ostream>
#include <string>
#include <vector>
@@ -21,6 +22,14 @@ class HostResolver;
// MockAuthHandler is used in tests to reliably trigger edge cases.
class HttpAuthHandlerMock : public HttpAuthHandler {
public:
+ enum class State {
+ WAIT_FOR_INIT,
+ WAIT_FOR_CHALLENGE,
+ WAIT_FOR_GENERATE_AUTH_TOKEN,
+ TOKEN_PENDING,
+ DONE
+ };
+
enum Resolve {
RESOLVE_INIT,
RESOLVE_SKIP,
@@ -88,6 +97,8 @@ class HttpAuthHandlerMock : public HttpAuthHandler {
return request_url_;
}
+ State state() const { return state_; }
+
// HttpAuthHandler:
HttpAuth::AuthorizationResult HandleAnotherChallenge(
HttpAuthChallengeTokenizer* challenge) override;
@@ -109,6 +120,7 @@ class HttpAuthHandlerMock : public HttpAuthHandler {
void OnGenerateAuthToken();
+ State state_;
Resolve resolve_;
CompletionCallback callback_;
bool generate_async_;
@@ -122,6 +134,8 @@ class HttpAuthHandlerMock : public HttpAuthHandler {
base::WeakPtrFactory<HttpAuthHandlerMock> weak_factory_;
};
+void PrintTo(const HttpAuthHandlerMock::State& state, ::std::ostream* os);
+
} // namespace net
#endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_
« no previous file with comments | « net/http/http_auth_controller.cc ('k') | net/http/http_auth_handler_mock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698