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 CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_ | 5 #ifndef CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_ |
6 #define CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_ | 6 #define CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const DataCallback& callback)); | 49 const DataCallback& callback)); |
50 MOCK_METHOD4(AsyncTpmAttestationFinishCertRequest, | 50 MOCK_METHOD4(AsyncTpmAttestationFinishCertRequest, |
51 void(const std::string& pca_response, | 51 void(const std::string& pca_response, |
52 chromeos::CryptohomeClient::AttestationKeyType key_type, | 52 chromeos::CryptohomeClient::AttestationKeyType key_type, |
53 const std::string& key_name, | 53 const std::string& key_name, |
54 const DataCallback& callback)); | 54 const DataCallback& callback)); |
55 MOCK_METHOD3(TpmAttestationRegisterKey, | 55 MOCK_METHOD3(TpmAttestationRegisterKey, |
56 void(chromeos::CryptohomeClient::AttestationKeyType key_type, | 56 void(chromeos::CryptohomeClient::AttestationKeyType key_type, |
57 const std::string& key_name, | 57 const std::string& key_name, |
58 const Callback& callback)); | 58 const Callback& callback)); |
59 MOCK_METHOD6(TpmAttestationSignEnterpriseChallenge, | 59 MOCK_METHOD7( |
60 void(chromeos::CryptohomeClient::AttestationKeyType key_type, | 60 TpmAttestationSignEnterpriseChallenge, |
61 const std::string& key_name, | 61 void(chromeos::CryptohomeClient::AttestationKeyType key_type, |
62 const std::string& domain, | 62 const std::string& key_name, |
63 const std::string& device_id, | 63 const std::string& domain, |
64 const std::string& challenge, | 64 const std::string& device_id, |
65 const DataCallback& callback)); | 65 chromeos::CryptohomeClient::AttestationChallengeOptions options, |
| 66 const std::string& challenge, |
| 67 const DataCallback& callback)); |
66 MOCK_METHOD4(TpmAttestationSignSimpleChallenge, | 68 MOCK_METHOD4(TpmAttestationSignSimpleChallenge, |
67 void(chromeos::CryptohomeClient::AttestationKeyType key_type, | 69 void(chromeos::CryptohomeClient::AttestationKeyType key_type, |
68 const std::string& key_name, | 70 const std::string& key_name, |
69 const std::string& challenge, | 71 const std::string& challenge, |
70 const DataCallback& callback)); | 72 const DataCallback& callback)); |
71 MOCK_METHOD2(AsyncGetSanitizedUsername, | 73 MOCK_METHOD2(AsyncGetSanitizedUsername, |
72 void(const std::string& user, | 74 void(const std::string& user, |
73 const DataCallback& callback)); | 75 const DataCallback& callback)); |
74 | 76 |
75 private: | 77 private: |
76 bool success_; | 78 bool success_; |
77 MountError return_code_; | 79 MountError return_code_; |
78 | 80 |
79 void DoCallback(Callback callback); | 81 void DoCallback(Callback callback); |
80 // Default fakes for attestation calls. | 82 // Default fakes for attestation calls. |
81 void FakeCreateEnrollRequest(const DataCallback& callback); | 83 void FakeCreateEnrollRequest(const DataCallback& callback); |
82 void FakeCreateCertRequest(const DataCallback& callback); | 84 void FakeCreateCertRequest(const DataCallback& callback); |
83 void FakeFinishCertRequest(const DataCallback& callback); | 85 void FakeFinishCertRequest(const DataCallback& callback); |
84 void FakeGetSanitizedUsername(const DataCallback& callback); | 86 void FakeGetSanitizedUsername(const DataCallback& callback); |
85 | 87 |
86 DISALLOW_COPY_AND_ASSIGN(MockAsyncMethodCaller); | 88 DISALLOW_COPY_AND_ASSIGN(MockAsyncMethodCaller); |
87 }; | 89 }; |
88 | 90 |
89 } // namespace cryptohome | 91 } // namespace cryptohome |
90 | 92 |
91 #endif // CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_ | 93 #endif // CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_ |
OLD | NEW |