diff options
Diffstat (limited to 'src/commands/cloud_command_proxy_unittest.cc')
-rw-r--r-- | src/commands/cloud_command_proxy_unittest.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/commands/cloud_command_proxy_unittest.cc b/src/commands/cloud_command_proxy_unittest.cc index c022b79..d3a9965 100644 --- a/src/commands/cloud_command_proxy_unittest.cc +++ b/src/commands/cloud_command_proxy_unittest.cc @@ -12,9 +12,8 @@ #include <weave/provider/test/fake_task_runner.h> #include <weave/test/unittest_utils.h> -#include "src/commands/command_dictionary.h" #include "src/commands/command_instance.h" -#include "src/states/mock_state_change_queue_interface.h" +#include "src/mock_component_manager.h" using testing::_; using testing::DoAll; @@ -66,14 +65,14 @@ class TestBackoffEntry : public BackoffEntry { class CloudCommandProxyTest : public ::testing::Test { protected: void SetUp() override { - // Set up the test StateChangeQueue. - auto callback = [this]( - const base::Callback<void(StateChangeQueueInterface::UpdateID)>& call) { + // Set up the test ComponentManager. + auto callback = + [this](const base::Callback<void(ComponentManager::UpdateID)>& call) { return callbacks_.Add(call).release(); }; - EXPECT_CALL(state_change_queue_, MockAddOnStateUpdatedCallback(_)) + EXPECT_CALL(component_manager_, MockAddServerStateUpdatedCallback(_)) .WillRepeatedly(Invoke(callback)); - EXPECT_CALL(state_change_queue_, GetLastStateChangeId()) + EXPECT_CALL(component_manager_, GetLastStateChangeId()) .WillRepeatedly(testing::ReturnPointee(¤t_state_update_id_)); CreateCommandInstance(); @@ -102,7 +101,7 @@ class CloudCommandProxyTest : public ::testing::Test { // Finally construct the CloudCommandProxy we are going to test here. std::unique_ptr<CloudCommandProxy> proxy{new CloudCommandProxy{ - command_instance_.get(), &cloud_updater_, &state_change_queue_, + command_instance_.get(), &cloud_updater_, &component_manager_, std::move(backoff), &task_runner_}}; // CloudCommandProxy::CloudCommandProxy() subscribe itself to weave::Command // notifications. When weave::Command is being destroyed it sends @@ -110,10 +109,10 @@ class CloudCommandProxyTest : public ::testing::Test { proxy.release(); } - StateChangeQueueInterface::UpdateID current_state_update_id_{0}; - base::CallbackList<void(StateChangeQueueInterface::UpdateID)> callbacks_; + ComponentManager::UpdateID current_state_update_id_{0}; + base::CallbackList<void(ComponentManager::UpdateID)> callbacks_; testing::StrictMock<MockCloudCommandUpdateInterface> cloud_updater_; - testing::StrictMock<MockStateChangeQueueInterface> state_change_queue_; + testing::StrictMock<MockComponentManager> component_manager_; testing::StrictMock<provider::test::FakeTaskRunner> task_runner_; std::queue<base::Closure> task_queue_; std::unique_ptr<CommandInstance> command_instance_; |