aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2015-10-10 01:44:45 -0700
committerVitaly Buka <vitalybuka@google.com>2015-10-10 02:06:11 -0700
commitbaf7a95416a3313843d276b00acb530ec3c5b3c5 (patch)
tree6d9a68ed35ed4900b3589de46086ffaeb0cfb9cd
parentbe39e9339baa85af546344da40b0663a6aea1a97 (diff)
downloadweaved-baf7a95416a3313843d276b00acb530ec3c5b3c5.tar.gz
Command::Complete should set results instead of progress
Change-Id: I81bc8124ebf41a62b69df58032f38c825a03b817
-rw-r--r--buffet/dbus_command_proxy.cc4
-rw-r--r--buffet/dbus_command_proxy.h4
-rw-r--r--buffet/dbus_command_proxy_unittest.cc2
3 files changed, 3 insertions, 7 deletions
diff --git a/buffet/dbus_command_proxy.cc b/buffet/dbus_command_proxy.cc
index 8c5c99f..327aea3 100644
--- a/buffet/dbus_command_proxy.cc
+++ b/buffet/dbus_command_proxy.cc
@@ -104,8 +104,8 @@ bool DBusCommandProxy::Complete(chromeos::ErrorPtr* error,
ConvertError(*weave_error, error);
return false;
}
- dbus_adaptor_.SetProgress(
- DictionaryToDBusVariantDictionary(*command->GetProgress()));
+ dbus_adaptor_.SetResults(
+ DictionaryToDBusVariantDictionary(*command->GetResults()));
dbus_adaptor_.SetState(EnumToString(command->GetState()));
return true;
}
diff --git a/buffet/dbus_command_proxy.h b/buffet/dbus_command_proxy.h
index 68f2055..dd9e679 100644
--- a/buffet/dbus_command_proxy.h
+++ b/buffet/dbus_command_proxy.h
@@ -36,17 +36,13 @@ class DBusCommandProxy : public com::android::Weave::CommandInterface {
completion_callback);
private:
- // Handles calls to com.android.Weave.Command.SetProgress(progress).
bool SetProgress(chromeos::ErrorPtr* error,
const chromeos::VariantDictionary& progress) override;
- // Handles calls to com.android.Weave.Command.Complete(results).
bool Complete(chromeos::ErrorPtr* error,
const chromeos::VariantDictionary& results) override;
- // Handles calls to com.android.Weave.Command.Abort().
bool Abort(chromeos::ErrorPtr* error,
const std::string& code,
const std::string& message) override;
- // Handles calls to com.android.Weave.Command.Cancel().
bool Cancel(chromeos::ErrorPtr* error) override;
std::weak_ptr<weave::Command> command_;
diff --git a/buffet/dbus_command_proxy_unittest.cc b/buffet/dbus_command_proxy_unittest.cc
index 5988d98..06a393e 100644
--- a/buffet/dbus_command_proxy_unittest.cc
+++ b/buffet/dbus_command_proxy_unittest.cc
@@ -78,7 +78,7 @@ class DBusCommandProxyTest : public ::testing::Test {
EXPECT_CALL(*command_, MockGetProgress())
.WillRepeatedly(ReturnRefOfCopy<std::string>("{}"));
EXPECT_CALL(*command_, MockGetResults())
- .WillOnce(ReturnRefOfCopy<std::string>("{}"));
+ .WillRepeatedly(ReturnRefOfCopy<std::string>("{}"));
// Set up a mock ExportedObject to be used with the DBus command proxy.
std::string cmd_path = buffet::dbus_constants::kCommandServicePathPrefix;