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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_DBUS_MOCK_CRYPTOHOME_CLIENT_H_
6 #define CHROMEOS_DBUS_MOCK_CRYPTOHOME_CLIENT_H_
10 #include "chromeos/dbus/cryptohome_client.h"
11 #include "testing/gmock/include/gmock/gmock.h"
15 class MockCryptohomeClient
: public CryptohomeClient
{
17 MockCryptohomeClient();
18 virtual ~MockCryptohomeClient();
20 MOCK_METHOD1(SetAsyncCallStatusHandler
,
21 void(const AsyncCallStatusHandler
& handler
));
22 MOCK_METHOD0(ResetAsyncCallStatusHandler
, void());
23 MOCK_METHOD1(IsMounted
, void(const BoolDBusMethodCallback
& callback
));
24 MOCK_METHOD1(Unmount
, bool(bool* success
));
25 MOCK_METHOD3(AsyncCheckKey
,
26 void(const std::string
& username
,
27 const std::string
& key
,
28 const AsyncMethodCallback
& callback
));
29 MOCK_METHOD4(AsyncMigrateKey
,
30 void(const std::string
& username
,
31 const std::string
& from_key
,
32 const std::string
& to_key
,
33 const AsyncMethodCallback
& callback
));
34 MOCK_METHOD2(AsyncRemove
, void(const std::string
& username
,
35 const AsyncMethodCallback
& callback
));
36 MOCK_METHOD1(GetSystemSalt
, bool(std::vector
<uint8
>* salt
));
37 MOCK_METHOD4(AsyncMount
, void(const std::string
& username
,
38 const std::string
& key
,
39 const bool create_if_missing
,
40 const AsyncMethodCallback
& callback
));
41 MOCK_METHOD1(AsyncMountGuest
,
42 void(const AsyncMethodCallback
& callback
));
43 MOCK_METHOD1(TpmIsReady
, void(const BoolDBusMethodCallback
& callback
));
44 MOCK_METHOD1(TpmIsEnabled
, void(const BoolDBusMethodCallback
& callback
));
45 MOCK_METHOD1(CallTpmIsEnabledAndBlock
, bool(bool* enabled
));
46 MOCK_METHOD1(TpmGetPassword
, void(const StringDBusMethodCallback
& callback
));
47 MOCK_METHOD1(TpmIsOwned
, bool(bool* owned
));
48 MOCK_METHOD1(TpmIsBeingOwned
, bool(bool* owning
));
49 MOCK_METHOD1(TpmCanAttemptOwnership
,
50 void(const VoidDBusMethodCallback
& callback
));
51 MOCK_METHOD0(TpmClearStoredPassword
, bool());
52 MOCK_METHOD1(Pkcs11IsTpmTokenReady
,
53 void(const BoolDBusMethodCallback
& callback
));
54 MOCK_METHOD1(Pkcs11GetTpmTokenInfo
,
55 void(const Pkcs11GetTpmTokenInfoCallback
& callback
));
56 MOCK_METHOD3(InstallAttributesGet
,
57 bool(const std::string
& name
,
58 std::vector
<uint8
>* value
,
60 MOCK_METHOD3(InstallAttributesSet
,
61 bool(const std::string
& name
,
62 const std::vector
<uint8
>& value
,
64 MOCK_METHOD1(InstallAttributesFinalize
, bool(bool* successful
));
65 MOCK_METHOD1(InstallAttributesIsReady
, bool(bool* is_ready
));
66 MOCK_METHOD1(InstallAttributesIsInvalid
, bool(bool* is_invalid
));
67 MOCK_METHOD1(InstallAttributesIsFirstInstall
, bool(bool* is_first_install
));
70 } // namespace chromeos
72 #endif // CHROMEOS_DBUS_MOCK_CRYPTOHOME_CLIENT_H_