Chromium Code Reviews| Index: chromeos/dbus/fake_update_engine_client.h |
| diff --git a/chromeos/dbus/fake_update_engine_client.h b/chromeos/dbus/fake_update_engine_client.h |
| index ccf25041be4164e05b85bb6816f477a7f66e90e6..a8cfd4fc1b3759c4b69d1aac5c7c57f05dc59e3a 100644 |
| --- a/chromeos/dbus/fake_update_engine_client.h |
| +++ b/chromeos/dbus/fake_update_engine_client.h |
| @@ -5,6 +5,7 @@ |
| #ifndef CHROMEOS_DBUS_FAKE_UPDATE_ENGINE_CLIENT_H_ |
| #define CHROMEOS_DBUS_FAKE_UPDATE_ENGINE_CLIENT_H_ |
| +#include <queue> |
| #include <string> |
| #include "chromeos/dbus/update_engine_client.h" |
| @@ -31,6 +32,15 @@ class FakeUpdateEngineClient : public UpdateEngineClient { |
| OVERRIDE; |
| virtual Status GetLastStatus() OVERRIDE; |
| + // Push UpdateEngineClient::Status in the queue to test changing status. |
| + // GetLastStatus() returns the status set by this method in FIFO order. |
| + // See set_update_engine_client_status() as well. |
| + void PushLastStatus(const UpdateEngineClient::Status& status) { |
| + status_queue_.push(status); |
| + } |
| + |
| + // Sets the default update_engine_client_status() as well. GetLastStatus() |
| + // returns the value set here if |status_queue_| is empty. |
| void set_update_engine_client_status( |
| const UpdateEngineClient::Status& status); |
| @@ -44,6 +54,7 @@ class FakeUpdateEngineClient : public UpdateEngineClient { |
| } |
| private: |
| + std::queue<UpdateEngineClient::Status> status_queue_; |
| UpdateEngineClient::Status update_engine_client_status_; |
|
hashimoto
2013/05/14 10:37:21
How about renaming this to default_status_ to clar
Haruki Sato
2013/05/14 13:20:14
Good point. It is used for another unittest.
Renam
|
| UpdateEngineClient::UpdateCheckResult update_check_result_; |
| int reboot_after_update_call_count_; |