password_manager::metrics_util::LogUMAHistogramBoolean should upload
[chromium-blink-merge.git] / chromeos / cryptohome / mock_homedir_methods.h
blob8647744d2c5107d64725f011d436a798178f8c9f
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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_
6 #define CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "chromeos/cryptohome/homedir_methods.h"
13 #include "testing/gmock/include/gmock/gmock.h"
15 namespace cryptohome {
17 class CHROMEOS_EXPORT MockHomedirMethods : public HomedirMethods {
18 public:
19 MockHomedirMethods();
20 virtual ~MockHomedirMethods();
22 void SetUp(bool success, MountError return_code);
24 MOCK_METHOD3(GetKeyDataEx,
25 void(const Identification& id,
26 const std::string& label,
27 const GetKeyDataCallback& callback));
28 MOCK_METHOD3(CheckKeyEx,
29 void(const Identification& id,
30 const Authorization& key,
31 const Callback& callback));
32 MOCK_METHOD4(MountEx,
33 void(const Identification& id,
34 const Authorization& key,
35 const MountParameters& request,
36 const MountCallback& callback));
37 MOCK_METHOD5(AddKeyEx,
38 void(const Identification& id,
39 const Authorization& auth,
40 const KeyDefinition& key,
41 bool clobber_if_exist,
42 const Callback& callback));
43 MOCK_METHOD4(RemoveKeyEx,
44 void(const Identification& id,
45 const Authorization& auth,
46 const std::string& label,
47 const Callback& callback));
48 MOCK_METHOD5(UpdateKeyEx,
49 void(const Identification& id,
50 const Authorization& auth,
51 const KeyDefinition& key,
52 const std::string& signature,
53 const Callback& callback));
55 private:
56 bool success_;
57 MountError return_code_;
59 void DoCallback(const Callback& callback);
60 void DoGetDataCallback(const GetKeyDataCallback& callback);
61 void DoMountCallback(const MountCallback& callback);
63 DISALLOW_COPY_AND_ASSIGN(MockHomedirMethods);
66 } // namespace cryptohome
68 #endif // CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_