| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chromeos/dbus/fake_debug_daemon_client.h" | 5 #include "chromeos/dbus/fake_debug_daemon_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 | 137 |
| 138 void FakeDebugDaemonClient::GetUserLogFiles(const GetLogsCallback& callback) { | 138 void FakeDebugDaemonClient::GetUserLogFiles(const GetLogsCallback& callback) { |
| 139 std::map<std::string, std::string> user_logs; | 139 std::map<std::string, std::string> user_logs; |
| 140 user_logs["preferences"] = "Preferences"; | 140 user_logs["preferences"] = "Preferences"; |
| 141 user_logs["invalid_file"] = "Invalid File"; | 141 user_logs["invalid_file"] = "Invalid File"; |
| 142 base::ThreadTaskRunnerHandle::Get()->PostTask( | 142 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 143 FROM_HERE, base::Bind(callback, true, user_logs)); | 143 FROM_HERE, base::Bind(callback, true, user_logs)); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void FakeDebugDaemonClient::GetLog(const std::string& log_name, |
| 147 const GetLogsCallback& callback) { |
| 148 std::map<std::string, std::string> sample; |
| 149 sample[log_name] = "Response from individual log"; |
| 150 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 151 FROM_HERE, base::Bind(callback, true, sample)); |
| 152 } |
| 153 |
| 146 void FakeDebugDaemonClient::TestICMP(const std::string& ip_address, | 154 void FakeDebugDaemonClient::TestICMP(const std::string& ip_address, |
| 147 const TestICMPCallback& callback) { | 155 const TestICMPCallback& callback) { |
| 148 base::ThreadTaskRunnerHandle::Get()->PostTask( | 156 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 149 FROM_HERE, base::Bind(callback, false, "")); | 157 FROM_HERE, base::Bind(callback, false, "")); |
| 150 } | 158 } |
| 151 | 159 |
| 152 void FakeDebugDaemonClient::TestICMPWithOptions( | 160 void FakeDebugDaemonClient::TestICMPWithOptions( |
| 153 const std::string& ip_address, | 161 const std::string& ip_address, |
| 154 const std::map<std::string, std::string>& options, | 162 const std::map<std::string, std::string>& options, |
| 155 const TestICMPCallback& callback) { | 163 const TestICMPCallback& callback) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 const base::Closure& error_callback) { | 253 const base::Closure& error_callback) { |
| 246 const bool has_printer = base::ContainsKey(printers_, name); | 254 const bool has_printer = base::ContainsKey(printers_, name); |
| 247 if (has_printer) | 255 if (has_printer) |
| 248 printers_.erase(name); | 256 printers_.erase(name); |
| 249 | 257 |
| 250 base::ThreadTaskRunnerHandle::Get()->PostTask( | 258 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 251 FROM_HERE, base::Bind(callback, has_printer)); | 259 FROM_HERE, base::Bind(callback, has_printer)); |
| 252 } | 260 } |
| 253 | 261 |
| 254 } // namespace chromeos | 262 } // namespace chromeos |
| OLD | NEW |