| 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 <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 | 12 |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/mac/scoped_cftyperef.h" | 14 #include "base/mac/scoped_cftyperef.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "chrome/common/mac/launchd.h" | 15 #include "chrome/common/mac/launchd.h" |
| 16 #include "chrome/common/multi_process_lock.h" | 16 #include "chrome/common/multi_process_lock.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class MessageLoop; | 19 class MessageLoop; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // TODO(dmaclach): Write this in terms of a real mock. | 22 // TODO(dmaclach): Write this in terms of a real mock. |
| 23 // http://crbug.com/76923 | 23 // http://crbug.com/76923 |
| 24 class MockLaunchd : public Launchd { | 24 class MockLaunchd : public Launchd { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 53 bool restart_called() const { return restart_called_; } | 53 bool restart_called() const { return restart_called_; } |
| 54 bool remove_called() const { return remove_called_; } | 54 bool remove_called() const { return remove_called_; } |
| 55 bool checkin_called() const { return checkin_called_; } | 55 bool checkin_called() const { return checkin_called_; } |
| 56 bool write_called() const { return write_called_; } | 56 bool write_called() const { return write_called_; } |
| 57 bool delete_called() const { return delete_called_; } | 57 bool delete_called() const { return delete_called_; } |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 base::FilePath file_; | 60 base::FilePath file_; |
| 61 std::string pipe_name_; | 61 std::string pipe_name_; |
| 62 base::MessageLoop* message_loop_; | 62 base::MessageLoop* message_loop_; |
| 63 scoped_ptr<MultiProcessLock> running_lock_; | 63 std::unique_ptr<MultiProcessLock> running_lock_; |
| 64 bool create_socket_; | 64 bool create_socket_; |
| 65 bool as_service_; | 65 bool as_service_; |
| 66 bool restart_called_; | 66 bool restart_called_; |
| 67 bool remove_called_; | 67 bool remove_called_; |
| 68 bool checkin_called_; | 68 bool checkin_called_; |
| 69 bool write_called_; | 69 bool write_called_; |
| 70 bool delete_called_; | 70 bool delete_called_; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 #endif // CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ | 73 #endif // CHROME_COMMON_MAC_MOCK_LAUNCHD_H_ |
| OLD | NEW |