| 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 #include "chromeos/cryptohome/mock_async_method_caller.h" | 5 #include "chromeos/cryptohome/mock_async_method_caller.h" |
| 6 | 6 |
| 7 using ::testing::Invoke; | 7 using ::testing::Invoke; |
| 8 using ::testing::WithArgs; | 8 using ::testing::WithArgs; |
| 9 using ::testing::_; | 9 using ::testing::_; |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 ON_CALL(*this, AsyncRemove(_, _)) | 44 ON_CALL(*this, AsyncRemove(_, _)) |
| 45 .WillByDefault( | 45 .WillByDefault( |
| 46 WithArgs<1>(Invoke(this, &MockAsyncMethodCaller::DoCallback))); | 46 WithArgs<1>(Invoke(this, &MockAsyncMethodCaller::DoCallback))); |
| 47 ON_CALL(*this, AsyncTpmAttestationCreateEnrollRequest(_)) | 47 ON_CALL(*this, AsyncTpmAttestationCreateEnrollRequest(_)) |
| 48 .WillByDefault( | 48 .WillByDefault( |
| 49 WithArgs<0>(Invoke(this, | 49 WithArgs<0>(Invoke(this, |
| 50 &MockAsyncMethodCaller::FakeCreateEnrollRequest))); | 50 &MockAsyncMethodCaller::FakeCreateEnrollRequest))); |
| 51 ON_CALL(*this, AsyncTpmAttestationEnroll(_, _)) | 51 ON_CALL(*this, AsyncTpmAttestationEnroll(_, _)) |
| 52 .WillByDefault( | 52 .WillByDefault( |
| 53 WithArgs<1>(Invoke(this, &MockAsyncMethodCaller::DoCallback))); | 53 WithArgs<1>(Invoke(this, &MockAsyncMethodCaller::DoCallback))); |
| 54 ON_CALL(*this, AsyncTpmAttestationCreateCertRequest(_, _)) | 54 ON_CALL(*this, AsyncTpmAttestationCreateCertRequest(_, _, _, _)) |
| 55 .WillByDefault( | 55 .WillByDefault( |
| 56 WithArgs<1>(Invoke(this, | 56 WithArgs<3>(Invoke(this, |
| 57 &MockAsyncMethodCaller::FakeCreateCertRequest))); | 57 &MockAsyncMethodCaller::FakeCreateCertRequest))); |
| 58 ON_CALL(*this, AsyncTpmAttestationFinishCertRequest(_, _, _, _)) | 58 ON_CALL(*this, AsyncTpmAttestationFinishCertRequest(_, _, _, _)) |
| 59 .WillByDefault( | 59 .WillByDefault( |
| 60 WithArgs<3>(Invoke(this, | 60 WithArgs<3>(Invoke(this, |
| 61 &MockAsyncMethodCaller::FakeFinishCertRequest))); | 61 &MockAsyncMethodCaller::FakeFinishCertRequest))); |
| 62 ON_CALL(*this, AsyncGetSanitizedUsername(_, _)) | 62 ON_CALL(*this, AsyncGetSanitizedUsername(_, _)) |
| 63 .WillByDefault( | 63 .WillByDefault( |
| 64 WithArgs<1>(Invoke(this, | 64 WithArgs<1>(Invoke(this, |
| 65 &MockAsyncMethodCaller:: | 65 &MockAsyncMethodCaller:: |
| 66 FakeGetSanitizedUsername))); | 66 FakeGetSanitizedUsername))); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 96 const DataCallback& callback) { | 96 const DataCallback& callback) { |
| 97 callback.Run(success_, kFakeSanitizedUsername); | 97 callback.Run(success_, kFakeSanitizedUsername); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void MockAsyncMethodCaller::FakeEnterpriseChallenge( | 100 void MockAsyncMethodCaller::FakeEnterpriseChallenge( |
| 101 const DataCallback& callback) { | 101 const DataCallback& callback) { |
| 102 callback.Run(success_, kFakeChallengeResponse); | 102 callback.Run(success_, kFakeChallengeResponse); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace cryptohome | 105 } // namespace cryptohome |
| OLD | NEW |