buffet: Allow setting command results.
Next step in command results support: now there is
CommandInstance::SetResults method which allows results
modifications.
BUG=chromium:435607
TEST=cros_workon_make --test buffet
Change-Id: I1f5da9c3613a2996cea3f65f07945cc64bfeda2e
Reviewed-on: https://chromium-review.googlesource.com/231337
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Anton Muhin <antonm@chromium.org>
Commit-Queue: Anton Muhin <antonm@chromium.org>
diff --git a/buffet/commands/cloud_command_proxy.cc b/buffet/commands/cloud_command_proxy.cc
index 5cbf6e6..8aa27ba 100644
--- a/buffet/commands/cloud_command_proxy.cc
+++ b/buffet/commands/cloud_command_proxy.cc
@@ -18,6 +18,12 @@
device_registration_info_(device_registration_info) {
}
+void CloudCommandProxy::OnResultsChanged(const native_types::Object& results) {
+ base::DictionaryValue patch;
+ patch.Set("results", TypedValueToJson(results, nullptr).get());
+ device_registration_info_->UpdateCommand(command_instance_->GetID(), patch);
+}
+
void CloudCommandProxy::OnStatusChanged(const std::string& status) {
base::DictionaryValue patch;
// TODO(antonm): Change status to state.