Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: chromeos/cryptohome/mock_homedir_methods.h

Issue 2540683002: Don't defer quitting in ExecuteScript and other helpers that use DOMMessageQueue. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_ 5 #ifndef CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_
6 #define CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_ 6 #define CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "chromeos/cryptohome/homedir_methods.h" 12 #include "chromeos/cryptohome/homedir_methods.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 14
15 namespace cryptohome { 15 namespace cryptohome {
16 16
17 class CHROMEOS_EXPORT MockHomedirMethods : public HomedirMethods { 17 class CHROMEOS_EXPORT MockHomedirMethods : public HomedirMethods {
18 public: 18 public:
19 MockHomedirMethods(); 19 MockHomedirMethods();
20 virtual ~MockHomedirMethods(); 20 ~MockHomedirMethods() override;
21 21
22 void SetUp(bool success, MountError return_code); 22 void SetUp(bool success, MountError return_code);
23 23
24 MOCK_METHOD3(GetKeyDataEx, 24 MOCK_METHOD3(GetKeyDataEx,
25 void(const Identification& id, 25 void(const Identification& id,
26 const std::string& label, 26 const std::string& label,
27 const GetKeyDataCallback& callback)); 27 const GetKeyDataCallback& callback));
28 MOCK_METHOD3(CheckKeyEx, 28 MOCK_METHOD3(CheckKeyEx,
29 void(const Identification& id, 29 void(const Identification& id,
30 const Authorization& key, 30 const Authorization& key,
(...skipping 21 matching lines...) Expand all
52 const std::string& signature, 52 const std::string& signature,
53 const Callback& callback)); 53 const Callback& callback));
54 MOCK_METHOD3(RenameCryptohome, 54 MOCK_METHOD3(RenameCryptohome,
55 void(const Identification& id_from, 55 void(const Identification& id_from,
56 const Identification& id_to, 56 const Identification& id_to,
57 const Callback& callback)); 57 const Callback& callback));
58 MOCK_METHOD2(GetAccountDiskUsage, 58 MOCK_METHOD2(GetAccountDiskUsage,
59 void(const Identification& id, 59 void(const Identification& id,
60 const GetAccountDiskUsageCallback& callback)); 60 const GetAccountDiskUsageCallback& callback));
61 61
62 void set_mount_callback(const base::Closure& callback) {
63 on_mount_called_ = callback;
64 }
65 void set_add_key_callback(const base::Closure& callback) {
66 on_add_key_called_ = callback;
67 }
68
62 private: 69 private:
63 bool success_;
64 MountError return_code_;
65
66 void DoCallback(const Callback& callback); 70 void DoCallback(const Callback& callback);
67 void DoGetDataCallback(const GetKeyDataCallback& callback); 71 void DoGetDataCallback(const GetKeyDataCallback& callback);
68 void DoMountCallback(const MountCallback& callback); 72 void DoMountCallback(const MountCallback& callback);
73 void DoAddKeyCallback(const Callback& callback);
74
75 bool success_ = false;
76 MountError return_code_ = MOUNT_ERROR_NONE;
77
78 base::Closure on_mount_called_;
79 base::Closure on_add_key_called_;
69 80
70 DISALLOW_COPY_AND_ASSIGN(MockHomedirMethods); 81 DISALLOW_COPY_AND_ASSIGN(MockHomedirMethods);
71 }; 82 };
72 83
73 } // namespace cryptohome 84 } // namespace cryptohome
74 85
75 #endif // CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_ 86 #endif // CHROMEOS_CRYPTOHOME_MOCK_HOMEDIR_METHODS_H_
OLDNEW
« no previous file with comments | « chrome/browser/plugins/flash_permission_browsertest.cc ('k') | chromeos/cryptohome/mock_homedir_methods.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698