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

Side by Side Diff: mock_platform.h

Issue 6729012: cryptohome: Add new platform functions (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cryptohome.git@master
Patch Set: . Created 9 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium OS 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 CRYPTOHOME_MOCK_PLATFORM_H_ 5 #ifndef CRYPTOHOME_MOCK_PLATFORM_H_
6 #define CRYPTOHOME_MOCK_PLATFORM_H_ 6 #define CRYPTOHOME_MOCK_PLATFORM_H_
7 7
8 #include "mount.h" 8 #include "mount.h"
9 9
10 #include <gmock/gmock.h> 10 #include <gmock/gmock.h>
11 11
(...skipping 17 matching lines...) Expand all
29 ~MockPlatform() {} 29 ~MockPlatform() {}
30 MOCK_METHOD4(Mount, bool(const std::string&, const std::string&, 30 MOCK_METHOD4(Mount, bool(const std::string&, const std::string&,
31 const std::string&, const std::string&)); 31 const std::string&, const std::string&));
32 MOCK_METHOD3(Unmount, bool(const std::string&, bool, bool*)); 32 MOCK_METHOD3(Unmount, bool(const std::string&, bool, bool*));
33 MOCK_METHOD1(IsDirectoryMounted, bool(const std::string&)); 33 MOCK_METHOD1(IsDirectoryMounted, bool(const std::string&));
34 MOCK_METHOD2(IsDirectoryMountedWith, bool(const std::string&, 34 MOCK_METHOD2(IsDirectoryMountedWith, bool(const std::string&,
35 const std::string&)); 35 const std::string&));
36 MOCK_METHOD2(TerminatePidsWithOpenFiles, bool(const std::string&, bool)); 36 MOCK_METHOD2(TerminatePidsWithOpenFiles, bool(const std::string&, bool));
37 MOCK_METHOD2(TerminatePidsForUser, bool(const uid_t, bool)); 37 MOCK_METHOD2(TerminatePidsForUser, bool(const uid_t, bool));
38 MOCK_METHOD3(SetOwnership, bool(const std::string&, uid_t, gid_t)); 38 MOCK_METHOD3(SetOwnership, bool(const std::string&, uid_t, gid_t));
39 MOCK_METHOD3(SetOwnershipRecursive, bool(const std::string&, uid_t, gid_t));
39 MOCK_METHOD3(GetUserId, bool(const std::string&, uid_t*, gid_t*)); 40 MOCK_METHOD3(GetUserId, bool(const std::string&, uid_t*, gid_t*));
41 MOCK_METHOD3(GetGroupId, bool(const std::string&, gid_t*));
40 MOCK_CONST_METHOD1(AmountOfFreeDiskSpace, int64(const std::string&)); 42 MOCK_CONST_METHOD1(AmountOfFreeDiskSpace, int64(const std::string&));
43 MOCK_METHOD2(Symlink, bool(const std::string&, const std::string&));
44 MOCK_METHOD4(Exec, bool(const std::string&, const std::vector<std::string>&,
45 uid_t, gid_t));
41 46
42 private: 47 private:
43 bool MockGetUserId(const std::string& user, uid_t* user_id, gid_t* group_id) { 48 bool MockGetUserId(const std::string& user, uid_t* user_id, gid_t* group_id) {
44 *user_id = getuid(); 49 *user_id = getuid();
45 *group_id = getgid(); 50 *group_id = getgid();
46 return true; 51 return true;
47 } 52 }
48 }; 53 };
49 } // namespace cryptohome 54 } // namespace cryptohome
50 55
51 #endif // CRYPTOHOME_MOCK_PLATFORM_H_ 56 #endif // CRYPTOHOME_MOCK_PLATFORM_H_
OLDNEW
« no previous file with comments | « no previous file | platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698