| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 Delegate* callback)); | 55 Delegate* callback)); |
| 56 MOCK_METHOD3(Mount, bool(const std::string& user_email, | 56 MOCK_METHOD3(Mount, bool(const std::string& user_email, |
| 57 const std::string& passhash, | 57 const std::string& passhash, |
| 58 int* error_code)); | 58 int* error_code)); |
| 59 MOCK_METHOD4(AsyncMount, bool(const std::string& user_email, | 59 MOCK_METHOD4(AsyncMount, bool(const std::string& user_email, |
| 60 const std::string& passhash, | 60 const std::string& passhash, |
| 61 const bool create_if_missing, | 61 const bool create_if_missing, |
| 62 Delegate* callback)); | 62 Delegate* callback)); |
| 63 MOCK_METHOD1(MountForBwsi, bool(int*)); | 63 MOCK_METHOD1(MountForBwsi, bool(int*)); |
| 64 MOCK_METHOD1(AsyncMountForBwsi, bool(Delegate* callback)); | 64 MOCK_METHOD1(AsyncMountForBwsi, bool(Delegate* callback)); |
| 65 MOCK_METHOD0(Unmount, bool(void)); |
| 65 MOCK_METHOD1(Remove, bool(const std::string& user_email)); | 66 MOCK_METHOD1(Remove, bool(const std::string& user_email)); |
| 66 MOCK_METHOD2(AsyncRemove, bool(const std::string& user_email, Delegate* d)); | 67 MOCK_METHOD2(AsyncRemove, bool(const std::string& user_email, Delegate* d)); |
| 67 MOCK_METHOD0(IsMounted, bool(void)); | 68 MOCK_METHOD0(IsMounted, bool(void)); |
| 68 MOCK_METHOD0(GetSystemSalt, CryptohomeBlob(void)); | 69 MOCK_METHOD0(GetSystemSalt, CryptohomeBlob(void)); |
| 69 | 70 |
| 70 void SetAsyncBehavior(bool outcome, int code) { | 71 void SetAsyncBehavior(bool outcome, int code) { |
| 71 outcome_ = outcome; | 72 outcome_ = outcome; |
| 72 code_ = code; | 73 code_ = code; |
| 73 } | 74 } |
| 74 | 75 |
| 75 bool DoCallback(Delegate* d) { | 76 bool DoCallback(Delegate* d) { |
| 76 d->OnComplete(outcome_, code_); | 77 d->OnComplete(outcome_, code_); |
| 77 return true; | 78 return true; |
| 78 } | 79 } |
| 79 | 80 |
| 80 private: | 81 private: |
| 81 bool outcome_; | 82 bool outcome_; |
| 82 int code_; | 83 int code_; |
| 83 DISALLOW_COPY_AND_ASSIGN(MockCryptohomeLibrary); | 84 DISALLOW_COPY_AND_ASSIGN(MockCryptohomeLibrary); |
| 84 }; | 85 }; |
| 85 } // namespace chromeos | 86 } // namespace chromeos |
| 86 | 87 |
| 87 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ | 88 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ |
| OLD | NEW |