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