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

Unified Diff: net/http/mock_allow_http_auth_preferences.h

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error on Windows and component build link error Created 5 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
Index: net/http/mock_allow_http_auth_preferences.h
diff --git a/net/http/mock_allow_http_auth_preferences.h b/net/http/mock_allow_http_auth_preferences.h
new file mode 100644
index 0000000000000000000000000000000000000000..08391c3edcf00860be5b7389e7095a07e2999f53
--- /dev/null
+++ b/net/http/mock_allow_http_auth_preferences.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_HTTP_MOCK_ALLOW_HTTP_AUTH_PREFERENCES_H_
+#define NET_HTTP_MOCK_ALLOW_HTTP_AUTH_PREFERENCES_H_
+
+#include "base/macros.h"
+#include "net/http/http_auth_preferences.h"
+
+namespace net {
+
+// An HttpAuthPreferences class containing a URLSecurityManager which is very
+// permissive and which should only be used in unit testing.
+class MockAllowHttpAuthPreferences : public HttpAuthPreferences {
+ public:
+ MockAllowHttpAuthPreferences();
+ ~MockAllowHttpAuthPreferences() override;
+
+ bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
+ bool CanDelegate(const GURL& auth_origin) const override;
+ void set_negotiate_disable_cname_lookup(bool disable_cname_lookup) {
+ disable_cname_lookup_ = disable_cname_lookup;
+ }
+ bool negotiate_disable_cname_lookup() const override;
+ void set_negotiate_enable_port(bool use_port) { use_port_ = use_port; }
+ bool negotiate_enable_port() const override;
+#if defined(OS_ANDROID)
+ void set_auth_android_negotiate_account_type(std::string account_type) {
+ account_type_ = account_type;
+ }
+ std::string auth_android_negotiate_account_type() const override;
+#endif
+
+ private:
+ bool disable_cname_lookup_;
+ bool use_port_;
+ std::string account_type_;
+ DISALLOW_COPY_AND_ASSIGN(MockAllowHttpAuthPreferences);
+};
+
+} // namespace net
+
+#endif // NET_HTTP_MOCK_ALLOW_HTTP_AUTH_PREFERENCES_H_

Powered by Google App Engine
This is Rietveld 408576698