Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: chromeos/dbus/fake_shill_device_client.cc

Issue 156353002: Implement networkingPrivate.setWifiTDLSEnabledState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable TDLS tests on non-chromeos Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/fake_shill_device_client.h ('k') | chromeos/dbus/fake_shill_manager_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_shill_device_client.cc
diff --git a/chromeos/dbus/fake_shill_device_client.cc b/chromeos/dbus/fake_shill_device_client.cc
index ca6e027671821992aa7328288d1529a1738ef37d..9f987bbcba973e887243c3d1bbbb5a2d4821cc72 100644
--- a/chromeos/dbus/fake_shill_device_client.cc
+++ b/chromeos/dbus/fake_shill_device_client.cc
@@ -32,15 +32,17 @@ void ErrorFunction(const std::string& device_path,
void PostDeviceNotFoundError(
const ShillDeviceClient::ErrorCallback& error_callback) {
- std::string error_name("org.chromium.flimflam.Error.Failure");
std::string error_message("Failed");
base::MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(error_callback, error_name, error_message));
+ FROM_HERE,
+ base::Bind(error_callback, shill::kErrorResultNotFound, error_message));
}
} // namespace
-FakeShillDeviceClient::FakeShillDeviceClient() : weak_ptr_factory_(this) {
+FakeShillDeviceClient::FakeShillDeviceClient()
+ : tdls_busy_count_(0),
+ weak_ptr_factory_(this) {
}
FakeShillDeviceClient::~FakeShillDeviceClient() {
@@ -202,6 +204,32 @@ void FakeShillDeviceClient::Reset(const dbus::ObjectPath& device_path,
base::MessageLoop::current()->PostTask(FROM_HERE, callback);
}
+void FakeShillDeviceClient::PerformTDLSOperation(
+ const dbus::ObjectPath& device_path,
+ const std::string& operation,
+ const std::string& peer,
+ const StringCallback& callback,
+ const ErrorCallback& error_callback) {
+ if (!stub_devices_.HasKey(device_path.value())) {
+ PostDeviceNotFoundError(error_callback);
+ return;
+ }
+ if (tdls_busy_count_) {
+ --tdls_busy_count_;
+ std::string error_message("In-Progress");
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(error_callback,
+ shill::kErrorResultInProgress, error_message));
+ return;
+ }
+ std::string result;
+ if (operation == shill::kTDLSStatusOperation)
+ result = shill::kTDLSConnectedState;
+ base::MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(callback, result));
+}
+
ShillDeviceClient::TestInterface* FakeShillDeviceClient::GetTestInterface() {
return this;
}
« no previous file with comments | « chromeos/dbus/fake_shill_device_client.h ('k') | chromeos/dbus/fake_shill_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698