diff options
author | Alex Vakulenko <avakulenko@google.com> | 2015-12-03 15:30:27 -0800 |
---|---|---|
committer | Alex Vakulenko <avakulenko@google.com> | 2015-12-04 02:18:42 +0000 |
commit | 88f55d8a6765d176973bfa0ce7d1000305ad6770 (patch) | |
tree | f813ba8b7db24209db2348089034017c192af205 /src/commands/cloud_command_proxy_unittest.cc | |
parent | b0efd87c2d06215f55e37f554006e1644483427e (diff) | |
download | libweave-88f55d8a6765d176973bfa0ce7d1000305ad6770.tar.gz |
Add "component" property to command instance
When sending commands, we'll use "component" to route the command to
the target component it was designated for.
As a temporary stop-gap, use "device" as the component name before
we have full implementation of component/trait schema model.
Also removed CommandDictionary from CommandInstance::FromJson since
the validation will be done outside of JSON parsing code in the future
Component Manager class.
BUG: 25841719
Change-Id: I5c649c257fb48ecaaedc1ced84931009f94c2bb3
Reviewed-on: https://weave-review.googlesource.com/1764
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
Diffstat (limited to 'src/commands/cloud_command_proxy_unittest.cc')
-rw-r--r-- | src/commands/cloud_command_proxy_unittest.cc | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/commands/cloud_command_proxy_unittest.cc b/src/commands/cloud_command_proxy_unittest.cc index 99ddffa..c022b79 100644 --- a/src/commands/cloud_command_proxy_unittest.cc +++ b/src/commands/cloud_command_proxy_unittest.cc @@ -76,28 +76,6 @@ class CloudCommandProxyTest : public ::testing::Test { EXPECT_CALL(state_change_queue_, GetLastStateChangeId()) .WillRepeatedly(testing::ReturnPointee(¤t_state_update_id_)); - // Set up the command schema. - auto json = CreateDictionaryValue(R"({ - 'calc': { - 'add': { - 'minimalRole': 'user', - 'parameters': { - 'value1': 'integer', - 'value2': 'integer' - }, - 'progress': { - 'status' : 'string' - }, - 'results': { - 'sum' : 'integer' - } - } - } - })"); - CHECK(json.get()); - CHECK(command_dictionary_.LoadCommands(*json, nullptr)) - << "Failed to parse test command dictionary"; - CreateCommandInstance(); } @@ -112,9 +90,8 @@ class CloudCommandProxyTest : public ::testing::Test { })"); CHECK(command_json.get()); - command_instance_ = - CommandInstance::FromJson(command_json.get(), Command::Origin::kCloud, - command_dictionary_, nullptr, nullptr); + command_instance_ = CommandInstance::FromJson( + command_json.get(), Command::Origin::kCloud, nullptr, nullptr); CHECK(command_instance_.get()); // Backoff - start at 1s and double with each backoff attempt and no jitter. @@ -139,7 +116,6 @@ class CloudCommandProxyTest : public ::testing::Test { testing::StrictMock<MockStateChangeQueueInterface> state_change_queue_; testing::StrictMock<provider::test::FakeTaskRunner> task_runner_; std::queue<base::Closure> task_queue_; - CommandDictionary command_dictionary_; std::unique_ptr<CommandInstance> command_instance_; }; |