Commit 13245b90 authored by Fergus Dall's avatar Fergus Dall Committed by Commit Bot

Fix NOTREACHED() in CiceroneClient

crrev.com/c/1611434 added a signal to CiceroneClient, but I forgot to
add it to OnSignalConnected which is not triggering a NOTREACHED on
startup. This CL corrects that.

Bug: 937748
Change-Id: I43078de38312da0db554279132f5f22844d91f13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636658
Commit-Queue: Fergus Dall <sidereal@google.com>
Auto-Submit: Fergus Dall <sidereal@google.com>
Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664642}
parent bdad5fe9
......@@ -86,6 +86,10 @@ class CiceroneClientImpl : public CiceroneClient {
return is_import_lxd_container_progress_signal_connected_;
}
bool IsPendingAppListUpdatesSignalConnected() override {
return is_pending_app_list_updates_signal_connected_;
}
void LaunchContainerApplication(
const vm_tools::cicerone::LaunchContainerApplicationRequest& request,
DBusMethodCallback<vm_tools::cicerone::LaunchContainerApplicationResponse>
......@@ -685,6 +689,9 @@ class CiceroneClientImpl : public CiceroneClient {
} else if (signal_name ==
vm_tools::cicerone::kImportLxdContainerProgressSignal) {
is_import_lxd_container_progress_signal_connected_ = is_connected;
} else if (signal_name ==
vm_tools::cicerone::kPendingAppListUpdatesSignal) {
is_pending_app_list_updates_signal_connected_ = is_connected;
} else {
NOTREACHED();
}
......@@ -705,6 +712,7 @@ class CiceroneClientImpl : public CiceroneClient {
bool is_lxd_container_starting_signal_connected_ = false;
bool is_export_lxd_container_progress_signal_connected_ = false;
bool is_import_lxd_container_progress_signal_connected_ = false;
bool is_pending_app_list_updates_signal_connected_ = false;
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
......
......@@ -133,6 +133,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) CiceroneClient : public DBusClient {
// This should be true prior to calling ImportLxdContainer.
virtual bool IsImportLxdContainerProgressSignalConnected() = 0;
// This should be true before expecting to recieve
// PendingAppListUpdatesSignal.
virtual bool IsPendingAppListUpdatesSignalConnected() = 0;
// Launches an application inside a running Container.
// |callback| is called after the method call finishes.
virtual void LaunchContainerApplication(
......
......@@ -98,6 +98,12 @@ bool FakeCiceroneClient::IsImportLxdContainerProgressSignalConnected() {
return is_import_lxd_container_progress_signal_connected_;
}
// Currently no tests need to change the output of this method. If you want to
// add one, make it return a variable like the above examples.
bool FakeCiceroneClient::IsPendingAppListUpdatesSignalConnected() {
return true;
}
void FakeCiceroneClient::LaunchContainerApplication(
const vm_tools::cicerone::LaunchContainerApplicationRequest& request,
DBusMethodCallback<vm_tools::cicerone::LaunchContainerApplicationResponse>
......
......@@ -64,6 +64,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeCiceroneClient
// This should be true prior to calling ImportLxdContainer.
bool IsImportLxdContainerProgressSignalConnected() override;
// This should be true before expecting to recieve
// PendingAppListUpdatesSignal.
bool IsPendingAppListUpdatesSignalConnected() override;
// Fake version of the method that launches an application inside a running
// Container. |callback| is called after the method call finishes.
void LaunchContainerApplication(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment