| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 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 |
| 5 #ifndef CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "net/http/http_transaction_factory.h" |
| 11 #include "net/url_request/url_request.h" |
| 12 #include "net/url_request/url_request_context.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 |
| 15 namespace net { |
| 16 class SSLCertRequestInfo; |
| 17 class X509Certificate; |
| 18 } |
| 19 |
| 20 class SSLClientAuthRequestorMock |
| 21 : public base::RefCountedThreadSafe<SSLClientAuthRequestorMock> { |
| 22 public: |
| 23 SSLClientAuthRequestorMock( |
| 24 net::URLRequest* request, |
| 25 net::SSLCertRequestInfo* cert_request_info) |
| 26 : cert_request_info_(cert_request_info), |
| 27 http_network_session_( |
| 28 request->context()->http_transaction_factory()->GetSession()) { |
| 29 } |
| 30 // NOTE: we need a vtable or else gmock blows up. |
| 31 virtual ~SSLClientAuthRequestorMock() { |
| 32 } |
| 33 |
| 34 MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert)); |
| 35 |
| 36 net::SSLCertRequestInfo* cert_request_info_; |
| 37 net::HttpNetworkSession* http_network_session_; |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ |
| OLD | NEW |