OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/dbus/fake_update_engine_client.h" | 5 #include "chromeos/dbus/fake_update_engine_client.h" |
6 | 6 |
7 namespace chromeos { | 7 namespace chromeos { |
8 | 8 |
9 FakeUpdateEngineClient::FakeUpdateEngineClient() | 9 FakeUpdateEngineClient::FakeUpdateEngineClient() |
10 : update_check_result_(UpdateEngineClient::UPDATE_RESULT_SUCCESS), | 10 : update_check_result_(UpdateEngineClient::UPDATE_RESULT_SUCCESS), |
(...skipping 22 matching lines...) Expand all Loading... |
33 reboot_after_update_call_count_++; | 33 reboot_after_update_call_count_++; |
34 } | 34 } |
35 | 35 |
36 void FakeUpdateEngineClient::SetReleaseTrack(const std::string& track) { | 36 void FakeUpdateEngineClient::SetReleaseTrack(const std::string& track) { |
37 } | 37 } |
38 | 38 |
39 void FakeUpdateEngineClient::GetReleaseTrack( | 39 void FakeUpdateEngineClient::GetReleaseTrack( |
40 const GetReleaseTrackCallback& callback) { | 40 const GetReleaseTrackCallback& callback) { |
41 } | 41 } |
42 | 42 |
43 FakeUpdateEngineClient::Status FakeUpdateEngineClient::GetLastStatus() { | 43 UpdateEngineClient::Status FakeUpdateEngineClient::GetLastStatus() { |
44 return update_engine_client_status_; | 44 if (status_queue_.empty()) |
| 45 return default_status_; |
| 46 |
| 47 UpdateEngineClient::Status last_status = status_queue_.front(); |
| 48 status_queue_.pop(); |
| 49 return last_status; |
45 } | 50 } |
46 | 51 |
47 void FakeUpdateEngineClient::set_update_engine_client_status( | 52 void FakeUpdateEngineClient::set_default_status( |
48 const UpdateEngineClient::Status& status) { | 53 const UpdateEngineClient::Status& status) { |
49 update_engine_client_status_ = status; | 54 default_status_ = status; |
50 } | 55 } |
51 | 56 |
52 void FakeUpdateEngineClient::set_update_check_result( | 57 void FakeUpdateEngineClient::set_update_check_result( |
53 const UpdateEngineClient::UpdateCheckResult& result) { | 58 const UpdateEngineClient::UpdateCheckResult& result) { |
54 update_check_result_ = result; | 59 update_check_result_ = result; |
55 } | 60 } |
56 | 61 |
57 } // namespace chromeos | 62 } // namespace chromeos |
OLD | NEW |