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

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

Issue 14589017: Use MockDBusThreadManagerWithoutGMock for GetUpdateStatusApiTest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename to default_status_ Created 7 years, 7 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 | Annotate | Revision Log
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),
(...skipping 22 matching lines...) Expand all
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
OLDNEW
« chromeos/dbus/fake_update_engine_client.h ('K') | « 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