MockHttpAuth.h (795B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef MockHttpAuth_h__ 6 #define MockHttpAuth_h__ 7 8 #include "nsIHttpAuthenticator.h" 9 10 namespace mozilla::net { 11 12 // This authenticator is only used for testing purposes. 13 class MockHttpAuth : public nsIHttpAuthenticator { 14 public: 15 NS_DECL_ISUPPORTS 16 NS_DECL_NSIHTTPAUTHENTICATOR 17 18 MockHttpAuth() = default; 19 20 static already_AddRefed<nsIHttpAuthenticator> Create() { 21 nsCOMPtr<nsIHttpAuthenticator> authenticator = new MockHttpAuth(); 22 return authenticator.forget(); 23 } 24 25 private: 26 virtual ~MockHttpAuth() = default; 27 }; 28 29 } // namespace mozilla::net 30 31 #endif // MockHttpAuth_h__