| 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 "base/memory/scoped_vector.h" | 7 #include <vector> |
| 8 |
| 8 #include "chromeos/cryptohome/cryptohome_parameters.h" | 9 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 9 #include "chromeos/cryptohome/mock_async_method_caller.h" | 10 #include "chromeos/cryptohome/mock_async_method_caller.h" |
| 10 | 11 |
| 11 using ::testing::Invoke; | 12 using ::testing::Invoke; |
| 12 using ::testing::WithArgs; | 13 using ::testing::WithArgs; |
| 13 using ::testing::_; | 14 using ::testing::_; |
| 14 | 15 |
| 15 namespace cryptohome { | 16 namespace cryptohome { |
| 16 | 17 |
| 17 MockHomedirMethods::MockHomedirMethods() | 18 MockHomedirMethods::MockHomedirMethods() |
| (...skipping 16 matching lines...) Expand all Loading... |
| 34 WithArgs<4>(Invoke(this, &MockHomedirMethods::DoCallback))); | 35 WithArgs<4>(Invoke(this, &MockHomedirMethods::DoCallback))); |
| 35 ON_CALL(*this, RemoveKeyEx(_, _, _, _)).WillByDefault( | 36 ON_CALL(*this, RemoveKeyEx(_, _, _, _)).WillByDefault( |
| 36 WithArgs<3>(Invoke(this, &MockHomedirMethods::DoCallback))); | 37 WithArgs<3>(Invoke(this, &MockHomedirMethods::DoCallback))); |
| 37 } | 38 } |
| 38 | 39 |
| 39 void MockHomedirMethods::DoCallback(const Callback& callback) { | 40 void MockHomedirMethods::DoCallback(const Callback& callback) { |
| 40 callback.Run(success_, return_code_); | 41 callback.Run(success_, return_code_); |
| 41 } | 42 } |
| 42 | 43 |
| 43 void MockHomedirMethods::DoGetDataCallback(const GetKeyDataCallback& callback) { | 44 void MockHomedirMethods::DoGetDataCallback(const GetKeyDataCallback& callback) { |
| 44 callback.Run(success_, return_code_, ScopedVector<RetrievedKeyData>()); | 45 callback.Run(success_, return_code_, std::vector<KeyDefinition>()); |
| 45 } | 46 } |
| 46 | 47 |
| 47 void MockHomedirMethods::DoMountCallback(const MountCallback& callback) { | 48 void MockHomedirMethods::DoMountCallback(const MountCallback& callback) { |
| 48 callback.Run( | 49 callback.Run( |
| 49 success_, return_code_, MockAsyncMethodCaller::kFakeSanitizedUsername); | 50 success_, return_code_, MockAsyncMethodCaller::kFakeSanitizedUsername); |
| 50 } | 51 } |
| 51 | 52 |
| 52 } // namespace cryptohome | 53 } // namespace cryptohome |
| OLD | NEW |