blob: a246c415b670dfe6e4b5408b5e2410996b246f8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/dbus/fake_update_engine_client.h"
namespace chromeos {
FakeUpdateEngineClient::FakeUpdateEngineClient()
: update_check_result_(UpdateEngineClient::UPDATE_RESULT_SUCCESS),
reboot_after_update_call_count_(0) {
}
FakeUpdateEngineClient::~FakeUpdateEngineClient() {
}
void FakeUpdateEngineClient::Init(dbus::Bus* bus) {
}
void FakeUpdateEngineClient::AddObserver(Observer* observer) {
}
void FakeUpdateEngineClient::RemoveObserver(Observer* observer) {
}
bool FakeUpdateEngineClient::HasObserver(Observer* observer) {
return false;
}
void FakeUpdateEngineClient::RequestUpdateCheck(
const UpdateCheckCallback& callback) {
callback.Run(update_check_result_);
}
void FakeUpdateEngineClient::RebootAfterUpdate() {
reboot_after_update_call_count_++;
}
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::SetChannel(const std::string& target_channel,
bool is_powerwash_allowed) {
}
void FakeUpdateEngineClient::GetChannel(bool get_current_channel,
const GetChannelCallback& callback) {
}
void FakeUpdateEngineClient::set_default_status(
const UpdateEngineClient::Status& status) {
default_status_ = status;
}
void FakeUpdateEngineClient::set_update_check_result(
const UpdateEngineClient::UpdateCheckResult& result) {
update_check_result_ = result;
}
} // namespace chromeos
|