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 "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::GetDebugLogs(base::File file
,
25 const GetDebugLogsCallback
& callback
) {
29 void FakeDebugDaemonClient::SetDebugMode(const std::string
& subsystem
,
30 const SetDebugModeCallback
& callback
) {
33 void FakeDebugDaemonClient::StartSystemTracing() {}
35 bool FakeDebugDaemonClient::RequestStopSystemTracing(
36 const StopSystemTracingCallback
& callback
) {
38 callback
.Run(base::RefCountedString::TakeString(&no_data
));
42 void FakeDebugDaemonClient::GetRoutes(bool numeric
,
44 const GetRoutesCallback
& callback
) {
45 std::vector
<std::string
> empty
;
46 base::MessageLoop::current()->PostTask(FROM_HERE
,
47 base::Bind(callback
, false, empty
));
50 void FakeDebugDaemonClient::GetNetworkStatus(
51 const GetNetworkStatusCallback
& callback
) {
52 base::MessageLoop::current()->PostTask(FROM_HERE
,
53 base::Bind(callback
, false, ""));
56 void FakeDebugDaemonClient::GetModemStatus(
57 const GetModemStatusCallback
& callback
) {
58 base::MessageLoop::current()->PostTask(FROM_HERE
,
59 base::Bind(callback
, false, ""));
62 void FakeDebugDaemonClient::GetWiMaxStatus(
63 const GetWiMaxStatusCallback
& callback
) {
64 base::MessageLoop::current()->PostTask(FROM_HERE
,
65 base::Bind(callback
, false, ""));
68 void FakeDebugDaemonClient::GetNetworkInterfaces(
69 const GetNetworkInterfacesCallback
& callback
) {
70 base::MessageLoop::current()->PostTask(FROM_HERE
,
71 base::Bind(callback
, false, ""));
74 void FakeDebugDaemonClient::GetPerfData(uint32_t duration
,
75 const GetPerfDataCallback
& callback
) {
76 std::vector
<uint8
> data
;
77 base::MessageLoop::current()->PostTask(FROM_HERE
, base::Bind(callback
, data
));
80 void FakeDebugDaemonClient::GetScrubbedLogs(const GetLogsCallback
& callback
) {
81 std::map
<std::string
, std::string
> sample
;
82 sample
["Sample Scrubbed Log"] = "Your email address is xxxxxxxx";
83 base::MessageLoop::current()->PostTask(FROM_HERE
,
84 base::Bind(callback
, false, sample
));
87 void FakeDebugDaemonClient::GetAllLogs(const GetLogsCallback
& callback
) {
88 std::map
<std::string
, std::string
> sample
;
89 sample
["Sample Log"] = "Your email address is abc@abc.com";
90 base::MessageLoop::current()->PostTask(FROM_HERE
,
91 base::Bind(callback
, false, sample
));
94 void FakeDebugDaemonClient::GetUserLogFiles(const GetLogsCallback
& callback
) {
95 std::map
<std::string
, std::string
> user_logs
;
96 user_logs
["preferences"] = "Preferences";
97 user_logs
["invalid_file"] = "Invalid File";
98 base::MessageLoop::current()->PostTask(FROM_HERE
,
99 base::Bind(callback
, true, user_logs
));
102 void FakeDebugDaemonClient::TestICMP(const std::string
& ip_address
,
103 const TestICMPCallback
& callback
) {
104 base::MessageLoop::current()->PostTask(FROM_HERE
,
105 base::Bind(callback
, false, ""));
108 void FakeDebugDaemonClient::TestICMPWithOptions(
109 const std::string
& ip_address
,
110 const std::map
<std::string
, std::string
>& options
,
111 const TestICMPCallback
& callback
) {
112 base::MessageLoop::current()->PostTask(FROM_HERE
,
113 base::Bind(callback
, false, ""));
116 void FakeDebugDaemonClient::UploadCrashes() {
119 } // namespace chromeos