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