OLD | NEW |
1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium OS 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 LOGIN_MANAGER_MOCK_OWNER_KEY_H_ | 5 #ifndef LOGIN_MANAGER_MOCK_OWNER_KEY_H_ |
6 #define LOGIN_MANAGER_MOCK_OWNER_KEY_H_ | 6 #define LOGIN_MANAGER_MOCK_OWNER_KEY_H_ |
7 | 7 |
8 #include "login_manager/owner_key.h" | 8 #include "login_manager/owner_key.h" |
9 | 9 |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 #include <gmock/gmock.h> | 11 #include <gmock/gmock.h> |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class RSAPrivateKey; | 14 class RSAPrivateKey; |
15 } | 15 } |
16 | 16 |
17 namespace login_manager { | 17 namespace login_manager { |
18 class MockOwnerKey : public OwnerKey { | 18 class MockOwnerKey : public OwnerKey { |
19 public: | 19 public: |
20 MockOwnerKey() : OwnerKey(FilePath("")) {} | 20 MockOwnerKey() : OwnerKey(FilePath("")) {} |
21 virtual ~MockOwnerKey() {} | 21 virtual ~MockOwnerKey() {} |
22 MOCK_CONST_METHOD1(Equals, bool(const std::string&)); | 22 MOCK_CONST_METHOD1(Equals, bool(const std::string&)); |
23 MOCK_CONST_METHOD1(VEquals, bool(const std::vector<uint8>&)); | 23 MOCK_CONST_METHOD1(VEquals, bool(const std::vector<uint8>&)); |
24 MOCK_METHOD0(HaveCheckedDisk, bool()); | 24 MOCK_CONST_METHOD0(HaveCheckedDisk, bool()); |
25 MOCK_METHOD0(IsPopulated, bool()); | 25 MOCK_CONST_METHOD0(IsPopulated, bool()); |
26 MOCK_METHOD0(PopulateFromDiskIfPossible, bool()); | 26 MOCK_METHOD0(PopulateFromDiskIfPossible, bool()); |
27 MOCK_METHOD1(PopulateFromBuffer, bool(const std::vector<uint8>&)); | 27 MOCK_METHOD1(PopulateFromBuffer, bool(const std::vector<uint8>&)); |
28 MOCK_METHOD1(PopulateFromKeypair, bool(base::RSAPrivateKey*)); | 28 MOCK_METHOD1(PopulateFromKeypair, bool(base::RSAPrivateKey*)); |
29 MOCK_METHOD0(Persist, bool()); | 29 MOCK_METHOD0(Persist, bool()); |
30 MOCK_METHOD3(Rotate, bool(const std::vector<uint8>&, const uint8*, uint32)); | 30 MOCK_METHOD3(Rotate, bool(const std::vector<uint8>&, const uint8*, uint32)); |
31 MOCK_METHOD1(ClobberCompromisedKey, void(const std::vector<uint8>&)); | 31 MOCK_METHOD1(ClobberCompromisedKey, void(const std::vector<uint8>&)); |
32 MOCK_METHOD4(Verify, bool(const uint8*, uint32, const uint8*, uint32)); | 32 MOCK_METHOD4(Verify, bool(const uint8*, uint32, const uint8*, uint32)); |
33 MOCK_METHOD3(Sign, bool(const uint8*, uint32, std::vector<uint8>*)); | 33 MOCK_METHOD3(Sign, bool(const uint8*, uint32, std::vector<uint8>*)); |
34 MOCK_METHOD1(StartGeneration, int(ChildJobInterface*)); | 34 MOCK_METHOD1(StartGeneration, int(ChildJobInterface*)); |
35 }; | 35 }; |
36 } // namespace login_manager | 36 } // namespace login_manager |
37 | 37 |
38 #endif // LOGIN_MANAGER_MOCK_OWNER_KEY_H_ | 38 #endif // LOGIN_MANAGER_MOCK_OWNER_KEY_H_ |
OLD | NEW |