1 /* vim:set ts=4 sw=2 sts=2 et ci: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // HttpLog.h should generally be included first
9 #include "MockHttpAuth.h"
11 namespace mozilla::net
{
13 NS_IMPL_ISUPPORTS(MockHttpAuth
, nsIHttpAuthenticator
)
15 NS_IMETHODIMP
MockHttpAuth::ChallengeReceived(
16 nsIHttpAuthenticableChannel
* aChannel
, const nsACString
& aChallenge
,
17 bool aProxyAuth
, nsISupports
** aSessionState
,
18 nsISupports
** aContinuationState
, bool* aInvalidatesIdentity
) {
19 *aInvalidatesIdentity
= false;
23 NS_IMETHODIMP
MockHttpAuth::GenerateCredentialsAsync(
24 nsIHttpAuthenticableChannel
* aChannel
,
25 nsIHttpAuthenticatorCallback
* aCallback
, const nsACString
& aChallenge
,
26 bool aProxyAuth
, const nsAString
& aDomain
, const nsAString
& aUser
,
27 const nsAString
& aPassword
, nsISupports
* aSessionState
,
28 nsISupports
* aContinuationState
, nsICancelable
** aCancel
) {
29 return NS_ERROR_NOT_IMPLEMENTED
;
32 NS_IMETHODIMP
MockHttpAuth::GenerateCredentials(
33 nsIHttpAuthenticableChannel
* aChannel
, const nsACString
& aChallenge
,
34 bool aProxyAuth
, const nsAString
& aDomain
, const nsAString
& aUser
,
35 const nsAString
& aPassword
, nsISupports
** aSessionState
,
36 nsISupports
** aContinuationState
, uint32_t* aFlags
, nsACString
& _retval
) {
37 _retval
.Assign("moz_test_credentials");
41 NS_IMETHODIMP
MockHttpAuth::GetAuthFlags(uint32_t* aAuthFlags
) {
42 *aAuthFlags
|= nsIHttpAuthenticator::CONNECTION_BASED
;
46 } // namespace mozilla::net