Make CommandManager::AddCommand() usable for both cloud and local cases
Add Command::Origin parameter to AddCommand as well as let it return
the cloud command ID for the command instance.
Change-Id: I694c72aba80bc0f0f240453bfab0d11e773d70aa
Reviewed-on: https://weave-review.googlesource.com/1786
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/mock_component_manager.h b/src/mock_component_manager.h
index 66b32d5..351e902 100644
--- a/src/mock_component_manager.h
+++ b/src/mock_component_manager.h
@@ -29,8 +29,8 @@
ErrorPtr* error));
MOCK_METHOD1(AddComponentTreeChangedCallback,
void(const base::Closure& callback));
- MOCK_METHOD1(MockAddCommand, void(CommandInstance* command_instance));
- MOCK_METHOD4(AddCommand, bool(const base::DictionaryValue& command,
+ MOCK_METHOD5(AddCommand, bool(const base::DictionaryValue& command,
+ Command::Origin command_origin,
UserRole role,
std::string* id,
ErrorPtr* error));
@@ -82,9 +82,6 @@
std::string(const std::string& trait));
private:
- void AddCommand(std::unique_ptr<CommandInstance> command_instance) override {
- MockAddCommand(command_instance.get());
- }
StateSnapshot GetAndClearRecordedStateChanges() override {
return std::move(MockGetAndClearRecordedStateChanges());
}