diff options
author | haruki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 08:42:04 +0000 |
---|---|---|
committer | haruki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 08:42:04 +0000 |
commit | e658b64fcc870ef4b05209e911b47a244de5b416 (patch) | |
tree | e922d7eff0cfa4b5a93f2d7be299f7378ae6e187 /chromeos/dbus/fake_update_engine_client.cc | |
parent | 82d4a016365cb01fa84d53b07f8f210500c86d2c (diff) | |
download | chromium_src-e658b64fcc870ef4b05209e911b47a244de5b416.zip chromium_src-e658b64fcc870ef4b05209e911b47a244de5b416.tar.gz chromium_src-e658b64fcc870ef4b05209e911b47a244de5b416.tar.bz2 |
Use MockDBusThreadManagerWithoutGMock for GetUpdateStatusApiTest
Adding a queue to emulate the changing status in FakeUpdateEngineClient.
BUG=239333
TEST=trybots
R=bartfab@chromium.org, hashimoto@chromium.org, kalman@chromium.org, nkostylev@chromium.org, satorux@chromium.org
Review URL: https://codereview.chromium.org/14589017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/fake_update_engine_client.cc')
-rw-r--r-- | chromeos/dbus/fake_update_engine_client.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/chromeos/dbus/fake_update_engine_client.cc b/chromeos/dbus/fake_update_engine_client.cc index 36618f8..be248d0 100644 --- a/chromeos/dbus/fake_update_engine_client.cc +++ b/chromeos/dbus/fake_update_engine_client.cc @@ -40,13 +40,18 @@ void FakeUpdateEngineClient::GetReleaseTrack( const GetReleaseTrackCallback& callback) { } -FakeUpdateEngineClient::Status FakeUpdateEngineClient::GetLastStatus() { - return update_engine_client_status_; +UpdateEngineClient::Status FakeUpdateEngineClient::GetLastStatus() { + if (status_queue_.empty()) + return default_status_; + + UpdateEngineClient::Status last_status = status_queue_.front(); + status_queue_.pop(); + return last_status; } -void FakeUpdateEngineClient::set_update_engine_client_status( +void FakeUpdateEngineClient::set_default_status( const UpdateEngineClient::Status& status) { - update_engine_client_status_ = status; + default_status_ = status; } void FakeUpdateEngineClient::set_update_check_result( |