| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/cros/cros_mock.h" | 5 #include "chrome/browser/chromeos/cros/cros_mock.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" | 10 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) | 232 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) |
| 233 .Times(1) | 233 .Times(1) |
| 234 .WillRepeatedly((Return(false))) | 234 .WillRepeatedly((Return(false))) |
| 235 .RetiresOnSaturation(); | 235 .RetiresOnSaturation(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void CrosMock::SetPowerLibraryStatusAreaExpectations() { | 238 void CrosMock::SetPowerLibraryStatusAreaExpectations() { |
| 239 EXPECT_CALL(*mock_power_library_, AddObserver(_)) | 239 EXPECT_CALL(*mock_power_library_, AddObserver(_)) |
| 240 .Times(3) | 240 .Times(3) |
| 241 .RetiresOnSaturation(); | 241 .RetiresOnSaturation(); |
| 242 EXPECT_CALL(*mock_power_library_, battery_fully_charged()) | 242 EXPECT_CALL(*mock_power_library_, IsBatteryFullyCharged()) |
| 243 .Times(1) | 243 .Times(1) |
| 244 .WillRepeatedly((Return(false))) | 244 .WillRepeatedly((Return(false))) |
| 245 .RetiresOnSaturation(); | 245 .RetiresOnSaturation(); |
| 246 EXPECT_CALL(*mock_power_library_, battery_is_present()) | 246 EXPECT_CALL(*mock_power_library_, IsBatteryPresent()) |
| 247 .Times(1) | 247 .Times(1) |
| 248 .WillOnce((Return(true))) | 248 .WillOnce((Return(true))) |
| 249 .RetiresOnSaturation(); | 249 .RetiresOnSaturation(); |
| 250 EXPECT_CALL(*mock_power_library_, battery_percentage()) | 250 EXPECT_CALL(*mock_power_library_, GetBatteryPercentage()) |
| 251 .Times(1) | 251 .Times(1) |
| 252 .WillRepeatedly((Return(42.0))) | 252 .WillRepeatedly((Return(42.0))) |
| 253 .RetiresOnSaturation(); | 253 .RetiresOnSaturation(); |
| 254 EXPECT_CALL(*mock_power_library_, line_power_on()) | 254 EXPECT_CALL(*mock_power_library_, IsLinePowerOn()) |
| 255 .Times(1) | 255 .Times(1) |
| 256 .WillRepeatedly((Return(false))) | 256 .WillRepeatedly((Return(false))) |
| 257 .RetiresOnSaturation(); | 257 .RetiresOnSaturation(); |
| 258 EXPECT_CALL(*mock_power_library_, battery_time_to_empty()) | 258 EXPECT_CALL(*mock_power_library_, GetBatteryTimeToEmpty()) |
| 259 .Times(1) | 259 .Times(1) |
| 260 .WillRepeatedly((Return(base::TimeDelta::FromMinutes(42)))) | 260 .WillRepeatedly((Return(base::TimeDelta::FromMinutes(42)))) |
| 261 .RetiresOnSaturation(); | 261 .RetiresOnSaturation(); |
| 262 EXPECT_CALL(*mock_power_library_, battery_time_to_full()) | 262 EXPECT_CALL(*mock_power_library_, GetBatteryTimeToFull()) |
| 263 .Times(1) | 263 .Times(1) |
| 264 .WillRepeatedly((Return(base::TimeDelta::FromMinutes(24)))) | 264 .WillRepeatedly((Return(base::TimeDelta::FromMinutes(24)))) |
| 265 .RetiresOnSaturation(); | 265 .RetiresOnSaturation(); |
| 266 EXPECT_CALL(*mock_power_library_, RemoveObserver(_)) | 266 EXPECT_CALL(*mock_power_library_, RemoveObserver(_)) |
| 267 .Times(3) | 267 .Times(3) |
| 268 .RetiresOnSaturation(); | 268 .RetiresOnSaturation(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void CrosMock::SetPowerLibraryExpectations() { | 271 void CrosMock::SetPowerLibraryExpectations() { |
| 272 // EnableScreenLock is currently bounded with a prefs value and thus is | 272 // EnableScreenLock is currently bounded with a prefs value and thus is |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 test_api()->SetNetworkLibrary(NULL, false); | 315 test_api()->SetNetworkLibrary(NULL, false); |
| 316 if (mock_power_library_) | 316 if (mock_power_library_) |
| 317 test_api()->SetPowerLibrary(NULL, false); | 317 test_api()->SetPowerLibrary(NULL, false); |
| 318 if (mock_screen_lock_library_) | 318 if (mock_screen_lock_library_) |
| 319 test_api()->SetScreenLockLibrary(NULL, false); | 319 test_api()->SetScreenLockLibrary(NULL, false); |
| 320 if (mock_speech_synthesis_library_) | 320 if (mock_speech_synthesis_library_) |
| 321 test_api()->SetSpeechSynthesisLibrary(NULL, false); | 321 test_api()->SetSpeechSynthesisLibrary(NULL, false); |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace chromeos | 324 } // namespace chromeos |
| OLD | NEW |