Roll BoringSSL.
[chromium-blink-merge.git] / chromeos / cryptohome / mock_homedir_methods.h
blob450acd25ed2b4ddd53bc31d023000befd6905394
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(CheckKeyEx,
25 void(const Identification& id,
26 const Authorization& key,
27 const Callback& callback));
28 MOCK_METHOD4(MountEx,
29 void(const Identification& id,
30 const Authorization& key,
31 const MountParameters& request,
32 const MountCallback& callback));
33 MOCK_METHOD5(AddKeyEx,
34 void(const Identification& id,
35 const Authorization& auth,
36 const KeyDefinition& key,
37 bool clobber_if_exist,
38 const Callback& callback));
39 MOCK_METHOD4(RemoveKeyEx,
40 void(const Identification& id,
41 const Authorization& auth,
42 const std::string& label,
43 const Callback& callback));
44 MOCK_METHOD5(UpdateKeyEx,
45 void(const Identification& id,
46 const Authorization& auth,
47 const KeyDefinition& key,
48 const std::string& signature,
49 const Callback& callback));
51 private:
52 bool success_;
53 MountError return_code_;
55 void DoCallback(const Callback& callback);
56 void DoMountCallback(const MountCallback& callback);
58 DISALLOW_COPY_AND_ASSIGN(MockHomedirMethods);
61 } // namespace cryptohome
63 #endif // CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_