| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_homedir_methods.h" | 5 #include "chromeos/cryptohome/mock_homedir_methods.h" |
| 6 | 6 |
| 7 #include "chromeos/cryptohome/mock_async_method_caller.h" | 7 #include "chromeos/cryptohome/mock_async_method_caller.h" |
| 8 | 8 |
| 9 using ::testing::Invoke; | 9 using ::testing::Invoke; |
| 10 using ::testing::WithArgs; | 10 using ::testing::WithArgs; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 success_ = success; | 21 success_ = success; |
| 22 return_code_ = return_code; | 22 return_code_ = return_code; |
| 23 ON_CALL(*this, CheckKeyEx(_, _, _)).WillByDefault( | 23 ON_CALL(*this, CheckKeyEx(_, _, _)).WillByDefault( |
| 24 WithArgs<2>(Invoke(this, &MockHomedirMethods::DoCallback))); | 24 WithArgs<2>(Invoke(this, &MockHomedirMethods::DoCallback))); |
| 25 ON_CALL(*this, MountEx(_, _, _, _)).WillByDefault( | 25 ON_CALL(*this, MountEx(_, _, _, _)).WillByDefault( |
| 26 WithArgs<3>(Invoke(this, &MockHomedirMethods::DoMountCallback))); | 26 WithArgs<3>(Invoke(this, &MockHomedirMethods::DoMountCallback))); |
| 27 ON_CALL(*this, AddKeyEx(_, _, _, _, _)).WillByDefault( | 27 ON_CALL(*this, AddKeyEx(_, _, _, _, _)).WillByDefault( |
| 28 WithArgs<4>(Invoke(this, &MockHomedirMethods::DoCallback))); | 28 WithArgs<4>(Invoke(this, &MockHomedirMethods::DoCallback))); |
| 29 ON_CALL(*this, UpdateKeyEx(_, _, _, _, _)).WillByDefault( | 29 ON_CALL(*this, UpdateKeyEx(_, _, _, _, _)).WillByDefault( |
| 30 WithArgs<4>(Invoke(this, &MockHomedirMethods::DoCallback))); | 30 WithArgs<4>(Invoke(this, &MockHomedirMethods::DoCallback))); |
| 31 ON_CALL(*this, RemoveKeyEx(_, _, _, _)).WillByDefault( |
| 32 WithArgs<3>(Invoke(this, &MockHomedirMethods::DoCallback))); |
| 31 } | 33 } |
| 32 | 34 |
| 33 void MockHomedirMethods::DoCallback(const Callback& callback) { | 35 void MockHomedirMethods::DoCallback(const Callback& callback) { |
| 34 callback.Run(success_, return_code_); | 36 callback.Run(success_, return_code_); |
| 35 } | 37 } |
| 36 | 38 |
| 37 void MockHomedirMethods::DoMountCallback(const MountCallback& callback) { | 39 void MockHomedirMethods::DoMountCallback(const MountCallback& callback) { |
| 38 callback.Run( | 40 callback.Run( |
| 39 success_, return_code_, MockAsyncMethodCaller::kFakeSanitizedUsername); | 41 success_, return_code_, MockAsyncMethodCaller::kFakeSanitizedUsername); |
| 40 } | 42 } |
| 41 | 43 |
| 42 } // namespace cryptohome | 44 } // namespace cryptohome |
| OLD | NEW |