Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Side by Side Diff: chromeos/cryptohome/mock_async_method_caller.h

Issue 27044004: Added multi-profile support for attestation on chromeos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 Callback callback)); 48 Callback callback));
49 MOCK_METHOD2(AsyncRemove, void(const std::string& user_email, 49 MOCK_METHOD2(AsyncRemove, void(const std::string& user_email,
50 Callback callback)); 50 Callback callback));
51 MOCK_METHOD1(AsyncTpmAttestationCreateEnrollRequest, 51 MOCK_METHOD1(AsyncTpmAttestationCreateEnrollRequest,
52 void(const DataCallback& callback)); 52 void(const DataCallback& callback));
53 MOCK_METHOD2(AsyncTpmAttestationEnroll, 53 MOCK_METHOD2(AsyncTpmAttestationEnroll,
54 void(const std::string& pca_response, const Callback& callback)); 54 void(const std::string& pca_response, const Callback& callback));
55 MOCK_METHOD4( 55 MOCK_METHOD4(
56 AsyncTpmAttestationCreateCertRequest, 56 AsyncTpmAttestationCreateCertRequest,
57 void(chromeos::attestation::AttestationCertificateProfile profile, 57 void(chromeos::attestation::AttestationCertificateProfile profile,
58 const std::string& user_email, 58 const std::string& user_id,
59 const std::string& request_origin, 59 const std::string& request_origin,
60 const DataCallback& callback)); 60 const DataCallback& callback));
61 MOCK_METHOD4(AsyncTpmAttestationFinishCertRequest, 61 MOCK_METHOD5(AsyncTpmAttestationFinishCertRequest,
62 void(const std::string& pca_response, 62 void(const std::string& pca_response,
63 chromeos::attestation::AttestationKeyType key_type, 63 chromeos::attestation::AttestationKeyType key_type,
64 const std::string& user_id,
64 const std::string& key_name, 65 const std::string& key_name,
65 const DataCallback& callback)); 66 const DataCallback& callback));
66 MOCK_METHOD3(TpmAttestationRegisterKey, 67 MOCK_METHOD4(TpmAttestationRegisterKey,
67 void(chromeos::attestation::AttestationKeyType key_type, 68 void(chromeos::attestation::AttestationKeyType key_type,
69 const std::string& user_id,
68 const std::string& key_name, 70 const std::string& key_name,
69 const Callback& callback)); 71 const Callback& callback));
70 MOCK_METHOD7( 72 MOCK_METHOD8(
71 TpmAttestationSignEnterpriseChallenge, 73 TpmAttestationSignEnterpriseChallenge,
72 void(chromeos::attestation::AttestationKeyType key_type, 74 void(chromeos::attestation::AttestationKeyType key_type,
75 const std::string& user_id,
73 const std::string& key_name, 76 const std::string& key_name,
74 const std::string& domain, 77 const std::string& domain,
75 const std::string& device_id, 78 const std::string& device_id,
76 chromeos::attestation::AttestationChallengeOptions options, 79 chromeos::attestation::AttestationChallengeOptions options,
77 const std::string& challenge, 80 const std::string& challenge,
78 const DataCallback& callback)); 81 const DataCallback& callback));
79 MOCK_METHOD4(TpmAttestationSignSimpleChallenge, 82 MOCK_METHOD5(TpmAttestationSignSimpleChallenge,
80 void(chromeos::attestation::AttestationKeyType key_type, 83 void(chromeos::attestation::AttestationKeyType key_type,
84 const std::string& user_id,
81 const std::string& key_name, 85 const std::string& key_name,
82 const std::string& challenge, 86 const std::string& challenge,
83 const DataCallback& callback)); 87 const DataCallback& callback));
84 MOCK_METHOD2(AsyncGetSanitizedUsername, 88 MOCK_METHOD2(AsyncGetSanitizedUsername,
85 void(const std::string& user, 89 void(const std::string& user,
86 const DataCallback& callback)); 90 const DataCallback& callback));
87 91
88 private: 92 private:
89 bool success_; 93 bool success_;
90 MountError return_code_; 94 MountError return_code_;
91 95
92 void DoCallback(Callback callback); 96 void DoCallback(Callback callback);
93 // Default fakes for attestation calls. 97 // Default fakes for attestation calls.
94 void FakeCreateEnrollRequest(const DataCallback& callback); 98 void FakeCreateEnrollRequest(const DataCallback& callback);
95 void FakeCreateCertRequest(const DataCallback& callback); 99 void FakeCreateCertRequest(const DataCallback& callback);
96 void FakeFinishCertRequest(const DataCallback& callback); 100 void FakeFinishCertRequest(const DataCallback& callback);
97 void FakeGetSanitizedUsername(const DataCallback& callback); 101 void FakeGetSanitizedUsername(const DataCallback& callback);
98 void FakeEnterpriseChallenge(const DataCallback& callback); 102 void FakeEnterpriseChallenge(const DataCallback& callback);
99 103
100 DISALLOW_COPY_AND_ASSIGN(MockAsyncMethodCaller); 104 DISALLOW_COPY_AND_ASSIGN(MockAsyncMethodCaller);
101 }; 105 };
102 106
103 } // namespace cryptohome 107 } // namespace cryptohome
104 108
105 #endif // CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_ 109 #endif // CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_
OLDNEW
« no previous file with comments | « chromeos/cryptohome/async_method_caller.cc ('k') | chromeos/cryptohome/mock_async_method_caller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698