| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 void CrosMock::SetPowerLibraryStatusAreaExpectations() { | 223 void CrosMock::SetPowerLibraryStatusAreaExpectations() { |
| 224 EXPECT_CALL(*mock_power_library_, AddObserver(_)) | 224 EXPECT_CALL(*mock_power_library_, AddObserver(_)) |
| 225 .Times(AnyNumber()) | 225 .Times(AnyNumber()) |
| 226 .RetiresOnSaturation(); | 226 .RetiresOnSaturation(); |
| 227 EXPECT_CALL(*mock_power_library_, RemoveObserver(_)) | 227 EXPECT_CALL(*mock_power_library_, RemoveObserver(_)) |
| 228 .Times(AnyNumber()) | 228 .Times(AnyNumber()) |
| 229 .RetiresOnSaturation(); | 229 .RetiresOnSaturation(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void CrosMock::SetPowerLibraryExpectations() { | 232 void CrosMock::SetPowerLibraryExpectations() { |
| 233 // EnableScreenLock is currently bounded with a prefs value and thus is | |
| 234 // always called when loading | |
| 235 EXPECT_CALL(*mock_power_library_, EnableScreenLock(_)) | |
| 236 .Times(AnyNumber()); | |
| 237 } | 233 } |
| 238 | 234 |
| 239 void CrosMock::TearDownMocks() { | 235 void CrosMock::TearDownMocks() { |
| 240 // Prevent bogus gMock leak check from firing. | 236 // Prevent bogus gMock leak check from firing. |
| 241 if (loader_) | 237 if (loader_) |
| 242 test_api()->SetLibraryLoader(NULL, false); | 238 test_api()->SetLibraryLoader(NULL, false); |
| 243 if (mock_cryptohome_library_) | 239 if (mock_cryptohome_library_) |
| 244 test_api()->SetCryptohomeLibrary(NULL, false); | 240 test_api()->SetCryptohomeLibrary(NULL, false); |
| 245 if (mock_network_library_) | 241 if (mock_network_library_) |
| 246 test_api()->SetNetworkLibrary(NULL, false); | 242 test_api()->SetNetworkLibrary(NULL, false); |
| 247 if (mock_power_library_) | 243 if (mock_power_library_) |
| 248 test_api()->SetPowerLibrary(NULL, false); | 244 test_api()->SetPowerLibrary(NULL, false); |
| 249 if (mock_screen_lock_library_) | 245 if (mock_screen_lock_library_) |
| 250 test_api()->SetScreenLockLibrary(NULL, false); | 246 test_api()->SetScreenLockLibrary(NULL, false); |
| 251 } | 247 } |
| 252 | 248 |
| 253 } // namespace chromeos | 249 } // namespace chromeos |
| OLD | NEW |