Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Side by Side Diff: chromeos/dbus/fake_update_engine_client.cc

Issue 578293002: Fixed channel switch when user decides to switch to another channel in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EnsureCanUpdate() is restored back. Test is modified to mimic real environment. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/dbus/fake_update_engine_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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),
11 can_rollback_stub_result_(false), 11 can_rollback_stub_result_(false),
12 reboot_after_update_call_count_(0), 12 reboot_after_update_call_count_(0),
13 request_update_check_call_count_(0),
13 rollback_call_count_(0), 14 rollback_call_count_(0),
14 can_rollback_call_count_(0) { 15 can_rollback_call_count_(0) {
15 } 16 }
16 17
17 FakeUpdateEngineClient::~FakeUpdateEngineClient() { 18 FakeUpdateEngineClient::~FakeUpdateEngineClient() {
18 } 19 }
19 20
20 void FakeUpdateEngineClient::Init(dbus::Bus* bus) { 21 void FakeUpdateEngineClient::Init(dbus::Bus* bus) {
21 } 22 }
22 23
23 void FakeUpdateEngineClient::AddObserver(Observer* observer) { 24 void FakeUpdateEngineClient::AddObserver(Observer* observer) {
24 observers_.AddObserver(observer); 25 observers_.AddObserver(observer);
25 } 26 }
26 27
27 void FakeUpdateEngineClient::RemoveObserver(Observer* observer) { 28 void FakeUpdateEngineClient::RemoveObserver(Observer* observer) {
28 observers_.RemoveObserver(observer); 29 observers_.RemoveObserver(observer);
29 } 30 }
30 31
31 bool FakeUpdateEngineClient::HasObserver(Observer* observer) { 32 bool FakeUpdateEngineClient::HasObserver(Observer* observer) {
32 return false; 33 return observers_.HasObserver(observer);
33 } 34 }
34 35
35 void FakeUpdateEngineClient::RequestUpdateCheck( 36 void FakeUpdateEngineClient::RequestUpdateCheck(
36 const UpdateCheckCallback& callback) { 37 const UpdateCheckCallback& callback) {
38 request_update_check_call_count_++;
37 callback.Run(update_check_result_); 39 callback.Run(update_check_result_);
38 } 40 }
39 41
40 void FakeUpdateEngineClient::Rollback() { 42 void FakeUpdateEngineClient::Rollback() {
41 rollback_call_count_++; 43 rollback_call_count_++;
42 } 44 }
43 45
44 void FakeUpdateEngineClient::CanRollbackCheck( 46 void FakeUpdateEngineClient::CanRollbackCheck(
45 const RollbackCheckCallback& callback) { 47 const RollbackCheckCallback& callback) {
46 can_rollback_call_count_++; 48 can_rollback_call_count_++;
(...skipping 30 matching lines...) Expand all
77 const UpdateEngineClient::Status& status) { 79 const UpdateEngineClient::Status& status) {
78 default_status_ = status; 80 default_status_ = status;
79 } 81 }
80 82
81 void FakeUpdateEngineClient::set_update_check_result( 83 void FakeUpdateEngineClient::set_update_check_result(
82 const UpdateEngineClient::UpdateCheckResult& result) { 84 const UpdateEngineClient::UpdateCheckResult& result) {
83 update_check_result_ = result; 85 update_check_result_ = result;
84 } 86 }
85 87
86 } // namespace chromeos 88 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_update_engine_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698