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 #include "base/bind.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 |
7 namespace chromeos { | 10 namespace chromeos { |
8 | 11 |
9 FakeUpdateEngineClient::FakeUpdateEngineClient() | 12 FakeUpdateEngineClient::FakeUpdateEngineClient() |
10 : update_check_result_(UpdateEngineClient::UPDATE_RESULT_SUCCESS), | 13 : update_check_result_(UpdateEngineClient::UPDATE_RESULT_SUCCESS), |
11 can_rollback_stub_result_(false), | 14 can_rollback_stub_result_(false), |
12 reboot_after_update_call_count_(0), | 15 reboot_after_update_call_count_(0), |
13 request_update_check_call_count_(0), | 16 request_update_check_call_count_(0), |
14 rollback_call_count_(0), | 17 rollback_call_count_(0), |
15 can_rollback_call_count_(0) { | 18 can_rollback_call_count_(0) {} |
16 } | |
17 | 19 |
18 FakeUpdateEngineClient::~FakeUpdateEngineClient() { | 20 FakeUpdateEngineClient::~FakeUpdateEngineClient() { |
19 } | 21 } |
20 | 22 |
21 void FakeUpdateEngineClient::Init(dbus::Bus* bus) { | 23 void FakeUpdateEngineClient::Init(dbus::Bus* bus) { |
22 } | 24 } |
23 | 25 |
24 void FakeUpdateEngineClient::AddObserver(Observer* observer) { | 26 void FakeUpdateEngineClient::AddObserver(Observer* observer) { |
25 observers_.AddObserver(observer); | 27 observers_.AddObserver(observer); |
26 } | 28 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const UpdateEngineClient::Status& status) { | 68 const UpdateEngineClient::Status& status) { |
67 FOR_EACH_OBSERVER(Observer, observers_, UpdateStatusChanged(status)); | 69 FOR_EACH_OBSERVER(Observer, observers_, UpdateStatusChanged(status)); |
68 } | 70 } |
69 | 71 |
70 void FakeUpdateEngineClient::SetChannel(const std::string& target_channel, | 72 void FakeUpdateEngineClient::SetChannel(const std::string& target_channel, |
71 bool is_powerwash_allowed) { | 73 bool is_powerwash_allowed) { |
72 } | 74 } |
73 | 75 |
74 void FakeUpdateEngineClient::GetChannel(bool get_current_channel, | 76 void FakeUpdateEngineClient::GetChannel(bool get_current_channel, |
75 const GetChannelCallback& callback) { | 77 const GetChannelCallback& callback) { |
| 78 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 79 FROM_HERE, base::Bind(callback, std::string())); |
76 } | 80 } |
77 | 81 |
78 void FakeUpdateEngineClient::GetEolStatus( | 82 void FakeUpdateEngineClient::GetEolStatus( |
79 const GetEolStatusCallback& callback) {} | 83 const GetEolStatusCallback& callback) { |
| 84 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 85 FROM_HERE, |
| 86 base::Bind(callback, update_engine::EndOfLifeStatus::kSupported)); |
| 87 } |
80 | 88 |
81 void FakeUpdateEngineClient::set_default_status( | 89 void FakeUpdateEngineClient::set_default_status( |
82 const UpdateEngineClient::Status& status) { | 90 const UpdateEngineClient::Status& status) { |
83 default_status_ = status; | 91 default_status_ = status; |
84 } | 92 } |
85 | 93 |
86 void FakeUpdateEngineClient::set_update_check_result( | 94 void FakeUpdateEngineClient::set_update_check_result( |
87 const UpdateEngineClient::UpdateCheckResult& result) { | 95 const UpdateEngineClient::UpdateCheckResult& result) { |
88 update_check_result_ = result; | 96 update_check_result_ = result; |
89 } | 97 } |
90 | 98 |
91 } // namespace chromeos | 99 } // namespace chromeos |
OLD | NEW |