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
3 // found in the LICENSE file.
5 #include "chromeos/dbus/fake_debug_daemon_client.h"
11 #include "base/bind.h"
12 #include "base/callback.h"
13 #include "base/location.h"
14 #include "base/message_loop/message_loop.h"
18 FakeDebugDaemonClient::FakeDebugDaemonClient() {}
20 FakeDebugDaemonClient::~FakeDebugDaemonClient() {}
22 void FakeDebugDaemonClient::Init(dbus::Bus* bus) {}
24 void FakeDebugDaemonClient::DumpDebugLogs(
27 scoped_refptr<base::TaskRunner> task_runner,
28 const GetDebugLogsCallback& callback) {
32 void FakeDebugDaemonClient::SetDebugMode(const std::string& subsystem,
33 const SetDebugModeCallback& callback) {
36 void FakeDebugDaemonClient::StartSystemTracing() {}
38 bool FakeDebugDaemonClient::RequestStopSystemTracing(
39 scoped_refptr<base::TaskRunner> task_runner,
40 const StopSystemTracingCallback& callback) {
42 callback.Run(base::RefCountedString::TakeString(&no_data));
46 void FakeDebugDaemonClient::GetRoutes(bool numeric,
48 const GetRoutesCallback& callback) {
49 std::vector<std::string> empty;
50 base::MessageLoop::current()->PostTask(FROM_HERE,
51 base::Bind(callback, false, empty));
54 void FakeDebugDaemonClient::GetNetworkStatus(
55 const GetNetworkStatusCallback& callback) {
56 base::MessageLoop::current()->PostTask(FROM_HERE,
57 base::Bind(callback, false, ""));
60 void FakeDebugDaemonClient::GetModemStatus(
61 const GetModemStatusCallback& callback) {
62 base::MessageLoop::current()->PostTask(FROM_HERE,
63 base::Bind(callback, false, ""));
66 void FakeDebugDaemonClient::GetWiMaxStatus(
67 const GetWiMaxStatusCallback& callback) {
68 base::MessageLoop::current()->PostTask(FROM_HERE,
69 base::Bind(callback, false, ""));
72 void FakeDebugDaemonClient::GetNetworkInterfaces(
73 const GetNetworkInterfacesCallback& callback) {
74 base::MessageLoop::current()->PostTask(FROM_HERE,
75 base::Bind(callback, false, ""));
78 void FakeDebugDaemonClient::GetPerfData(uint32_t duration,
79 const GetPerfDataCallback& callback) {
80 std::vector<uint8> data;
81 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, data));
84 void FakeDebugDaemonClient::GetScrubbedLogs(const GetLogsCallback& callback) {
85 std::map<std::string, std::string> sample;
86 sample["Sample Scrubbed Log"] = "Your email address is xxxxxxxx";
87 base::MessageLoop::current()->PostTask(FROM_HERE,
88 base::Bind(callback, false, sample));
91 void FakeDebugDaemonClient::GetAllLogs(const GetLogsCallback& callback) {
92 std::map<std::string, std::string> sample;
93 sample["Sample Log"] = "Your email address is abc@abc.com";
94 base::MessageLoop::current()->PostTask(FROM_HERE,
95 base::Bind(callback, false, sample));
98 void FakeDebugDaemonClient::GetUserLogFiles(const GetLogsCallback& callback) {
99 std::map<std::string, std::string> user_logs;
100 user_logs["preferences"] = "Preferences";
101 user_logs["invalid_file"] = "Invalid File";
102 base::MessageLoop::current()->PostTask(FROM_HERE,
103 base::Bind(callback, true, user_logs));
106 void FakeDebugDaemonClient::TestICMP(const std::string& ip_address,
107 const TestICMPCallback& callback) {
108 base::MessageLoop::current()->PostTask(FROM_HERE,
109 base::Bind(callback, false, ""));
112 void FakeDebugDaemonClient::TestICMPWithOptions(
113 const std::string& ip_address,
114 const std::map<std::string, std::string>& options,
115 const TestICMPCallback& callback) {
116 base::MessageLoop::current()->PostTask(FROM_HERE,
117 base::Bind(callback, false, ""));
120 void FakeDebugDaemonClient::UploadCrashes() {
123 } // namespace chromeos