mock_allow_http_auth_preferences.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_HTTP_MOCK_ALLOW_HTTP_AUTH_PREFERENCES_H_
  5. #define NET_HTTP_MOCK_ALLOW_HTTP_AUTH_PREFERENCES_H_
  6. #include "net/http/http_auth_preferences.h"
  7. namespace url {
  8. class SchemeHostPort;
  9. }
  10. namespace net {
  11. // An HttpAuthPreferences class which allows all origins to use default
  12. // credentials and delegate. This should only be used in unit testing.
  13. class MockAllowHttpAuthPreferences : public HttpAuthPreferences {
  14. public:
  15. MockAllowHttpAuthPreferences();
  16. MockAllowHttpAuthPreferences(const MockAllowHttpAuthPreferences&) = delete;
  17. MockAllowHttpAuthPreferences& operator=(const MockAllowHttpAuthPreferences&) =
  18. delete;
  19. ~MockAllowHttpAuthPreferences() override;
  20. bool CanUseDefaultCredentials(
  21. const url::SchemeHostPort& auth_scheme_host_port) const override;
  22. HttpAuth::DelegationType GetDelegationType(
  23. const url::SchemeHostPort& auth_scheme_host_port) const override;
  24. };
  25. } // namespace net
  26. #endif // NET_HTTP_MOCK_ALLOW_HTTP_AUTH_PREFERENCES_H_