OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ | 5 #ifndef CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ |
6 #define CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ | 6 #define CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ |
7 | 7 |
8 #include <launch.h> | 8 #include <launch.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... |
23 // http://crbug.com/76923 | 23 // http://crbug.com/76923 |
24 class MockLaunchd : public Launchd { | 24 class MockLaunchd : public Launchd { |
25 public: | 25 public: |
26 static bool MakeABundle(const base::FilePath& dst, | 26 static bool MakeABundle(const base::FilePath& dst, |
27 const std::string& name, | 27 const std::string& name, |
28 base::FilePath* bundle_root, | 28 base::FilePath* bundle_root, |
29 base::FilePath* executable); | 29 base::FilePath* executable); |
30 | 30 |
31 MockLaunchd(const base::FilePath& file, base::MessageLoop* loop, | 31 MockLaunchd(const base::FilePath& file, base::MessageLoop* loop, |
32 bool create_socket, bool as_service); | 32 bool create_socket, bool as_service); |
33 virtual ~MockLaunchd(); | 33 ~MockLaunchd() override; |
34 | 34 |
35 virtual CFDictionaryRef CopyExports() override; | 35 CFDictionaryRef CopyExports() override; |
36 virtual CFDictionaryRef CopyJobDictionary(CFStringRef label) override; | 36 CFDictionaryRef CopyJobDictionary(CFStringRef label) override; |
37 virtual CFDictionaryRef CopyDictionaryByCheckingIn(CFErrorRef* error) | 37 CFDictionaryRef CopyDictionaryByCheckingIn(CFErrorRef* error) override; |
38 override; | 38 bool RemoveJob(CFStringRef label, CFErrorRef* error) override; |
39 virtual bool RemoveJob(CFStringRef label, CFErrorRef* error) override; | 39 bool RestartJob(Domain domain, |
40 virtual bool RestartJob(Domain domain, | 40 Type type, |
41 Type type, | 41 CFStringRef name, |
42 CFStringRef name, | 42 CFStringRef session_type) override; |
43 CFStringRef session_type) override; | 43 CFMutableDictionaryRef CreatePlistFromFile(Domain domain, |
44 virtual CFMutableDictionaryRef CreatePlistFromFile( | 44 Type type, |
45 Domain domain, | 45 CFStringRef name) override; |
46 Type type, | 46 bool WritePlistToFile(Domain domain, |
47 CFStringRef name) override; | 47 Type type, |
48 virtual bool WritePlistToFile(Domain domain, | 48 CFStringRef name, |
49 Type type, | 49 CFDictionaryRef dict) override; |
50 CFStringRef name, | 50 bool DeletePlist(Domain domain, Type type, CFStringRef name) override; |
51 CFDictionaryRef dict) override; | |
52 virtual bool DeletePlist(Domain domain, | |
53 Type type, | |
54 CFStringRef name) override; | |
55 | 51 |
56 void SignalReady(); | 52 void SignalReady(); |
57 | 53 |
58 bool restart_called() const { return restart_called_; } | 54 bool restart_called() const { return restart_called_; } |
59 bool remove_called() const { return remove_called_; } | 55 bool remove_called() const { return remove_called_; } |
60 bool checkin_called() const { return checkin_called_; } | 56 bool checkin_called() const { return checkin_called_; } |
61 bool write_called() const { return write_called_; } | 57 bool write_called() const { return write_called_; } |
62 bool delete_called() const { return delete_called_; } | 58 bool delete_called() const { return delete_called_; } |
63 | 59 |
64 private: | 60 private: |
65 base::FilePath file_; | 61 base::FilePath file_; |
66 std::string pipe_name_; | 62 std::string pipe_name_; |
67 base::MessageLoop* message_loop_; | 63 base::MessageLoop* message_loop_; |
68 scoped_ptr<MultiProcessLock> running_lock_; | 64 scoped_ptr<MultiProcessLock> running_lock_; |
69 bool create_socket_; | 65 bool create_socket_; |
70 bool as_service_; | 66 bool as_service_; |
71 bool restart_called_; | 67 bool restart_called_; |
72 bool remove_called_; | 68 bool remove_called_; |
73 bool checkin_called_; | 69 bool checkin_called_; |
74 bool write_called_; | 70 bool write_called_; |
75 bool delete_called_; | 71 bool delete_called_; |
76 }; | 72 }; |
77 | 73 |
78 #endif // CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ | 74 #endif // CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ |
OLD | NEW |