OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ |
6 #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ | 6 #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 class HttpNetworkSession; | 13 class HttpNetworkSession; |
14 class SSLCertRequestInfo; | 14 class SSLCertRequestInfo; |
15 class URLRequest; | 15 class URLRequest; |
16 class X509Certificate; | 16 class X509Certificate; |
17 } | 17 } |
18 | 18 |
19 class SSLClientAuthRequestorMock | 19 class SSLClientAuthRequestorMock |
20 : public base::RefCountedThreadSafe<SSLClientAuthRequestorMock> { | 20 : public base::RefCountedThreadSafe<SSLClientAuthRequestorMock> { |
21 public: | 21 public: |
22 SSLClientAuthRequestorMock( | 22 SSLClientAuthRequestorMock( |
23 net::URLRequest* request, | 23 net::URLRequest* request, |
24 net::SSLCertRequestInfo* cert_request_info); | 24 net::SSLCertRequestInfo* cert_request_info); |
25 // NOTE: we need a vtable or else gmock blows up. | |
26 virtual ~SSLClientAuthRequestorMock(); | |
27 | 25 |
28 MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert)); | 26 MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert)); |
29 | 27 |
30 net::SSLCertRequestInfo* cert_request_info_; | 28 net::SSLCertRequestInfo* cert_request_info_; |
31 net::HttpNetworkSession* http_network_session_; | 29 net::HttpNetworkSession* http_network_session_; |
| 30 |
| 31 protected: |
| 32 friend class base::RefCountedThreadSafe<SSLClientAuthRequestorMock>; |
| 33 virtual ~SSLClientAuthRequestorMock(); |
32 }; | 34 }; |
33 | 35 |
34 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ | 36 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ |
OLD | NEW |