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 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
10 | 11 |
| 12 namespace content { |
| 13 class ClientCertificateDelegate; |
| 14 } |
| 15 |
11 namespace net { | 16 namespace net { |
12 class HttpNetworkSession; | 17 class HttpNetworkSession; |
13 class SSLCertRequestInfo; | 18 class SSLCertRequestInfo; |
14 class URLRequest; | 19 class URLRequest; |
15 class X509Certificate; | 20 class X509Certificate; |
16 } | 21 } |
17 | 22 |
18 class SSLClientAuthRequestorMock | 23 class SSLClientAuthRequestorMock |
19 : public base::RefCountedThreadSafe<SSLClientAuthRequestorMock> { | 24 : public base::RefCountedThreadSafe<SSLClientAuthRequestorMock> { |
20 public: | 25 public: |
21 SSLClientAuthRequestorMock( | 26 SSLClientAuthRequestorMock( |
22 net::URLRequest* request, | 27 net::URLRequest* request, |
23 const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info); | 28 const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info); |
24 | 29 |
| 30 scoped_ptr<content::ClientCertificateDelegate> CreateDelegate(); |
| 31 |
25 MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert)); | 32 MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert)); |
| 33 MOCK_METHOD0(CancelCertificateSelection, void()); |
26 | 34 |
27 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; | 35 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; |
28 | 36 |
29 protected: | 37 protected: |
30 friend class base::RefCountedThreadSafe<SSLClientAuthRequestorMock>; | 38 friend class base::RefCountedThreadSafe<SSLClientAuthRequestorMock>; |
31 virtual ~SSLClientAuthRequestorMock(); | 39 virtual ~SSLClientAuthRequestorMock(); |
32 }; | 40 }; |
33 | 41 |
34 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ | 42 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_ |
OLD | NEW |