summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/mock_cryptohome_client.h
blob: ad6c327b791c3a55b5b9dc66a5d32c1bde4466da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_DBUS_MOCK_CRYPTOHOME_CLIENT_H_
#define CHROMEOS_DBUS_MOCK_CRYPTOHOME_CLIENT_H_
#pragma once

#include <string>

#include "chromeos/dbus/cryptohome_client.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace chromeos {

class MockCryptohomeClient : public CryptohomeClient {
 public:
  MockCryptohomeClient();
  virtual ~MockCryptohomeClient();

  MOCK_METHOD1(SetAsyncCallStatusHandler, void(AsyncCallStatusHandler handler));
  MOCK_METHOD0(ResetAsyncCallStatusHandler, void());
  MOCK_METHOD1(IsMounted, bool(bool* is_mounted));
  MOCK_METHOD1(Unmount, bool(bool* success));
  MOCK_METHOD3(AsyncCheckKey,
               void(const std::string& username,
                    const std::string& key,
                    base::Callback<void(int async_id)> callback));
  MOCK_METHOD4(AsyncMigrateKey,
               void(const std::string& username,
                    const std::string& from_key,
                    const std::string& to_key,
                    base::Callback<void(int async_id)> callback));
  MOCK_METHOD2(AsyncRemove, void(const std::string& username,
                                 base::Callback<void(int async_id)> callback));
  MOCK_METHOD1(GetSystemSalt, bool(std::vector<uint8>* salt));
  MOCK_METHOD4(AsyncMount, void(const std::string& username,
                                const std::string& key,
                                const bool create_if_missing,
                                base::Callback<void(int async_id)> callback));
  MOCK_METHOD1(AsyncMountGuest,
               void(base::Callback<void(int async_id)> callback));
  MOCK_METHOD1(TpmIsReady, bool(bool* ready));
  MOCK_METHOD1(TpmIsEnabled, void(BoolMethodCallback callback));
  MOCK_METHOD1(CallTpmIsEnabledAndBlock, bool(bool* enabled));
  MOCK_METHOD1(TpmGetPassword, bool(std::string* password));
  MOCK_METHOD1(TpmIsOwned, bool(bool* owned));
  MOCK_METHOD1(TpmIsBeingOwned, bool(bool* owning));
  MOCK_METHOD0(TpmCanAttemptOwnership, bool());
  MOCK_METHOD0(TpmClearStoredPassword, bool());
  MOCK_METHOD1(Pkcs11IsTpmTokenReady, void(BoolMethodCallback callback));
  MOCK_METHOD1(Pkcs11GetTpmTokenInfo,
               void(Pkcs11GetTpmTokenInfoCallback callback));
  MOCK_METHOD3(InstallAttributesGet,
               bool(const std::string& name,
                    std::vector<uint8>* value,
                    bool* successful));
  MOCK_METHOD3(InstallAttributesSet,
               bool(const std::string& name,
                    const std::vector<uint8>& value,
                    bool* successful));
  MOCK_METHOD1(InstallAttributesFinalize, bool(bool* successful));
  MOCK_METHOD1(InstallAttributesIsReady, bool(bool* is_ready));
  MOCK_METHOD1(InstallAttributesIsInvalid, bool(bool* is_invalid));
  MOCK_METHOD1(InstallAttributesIsFirstInstall, bool(bool* is_first_install));
};

}  // namespace chromeos

#endif  // CHROMEOS_DBUS_MOCK_CRYPTOHOME_CLIENT_H_