Index: chromeos/dbus/mock_dbus_thread_manager.cc |
diff --git a/chromeos/dbus/mock_dbus_thread_manager.cc b/chromeos/dbus/mock_dbus_thread_manager.cc |
index be752b4700b0e3d0d07332db5d7687ddd85b1011..0d98b460dbf22f591f1bb40db2a295187737a157 100644 |
--- a/chromeos/dbus/mock_dbus_thread_manager.cc |
+++ b/chromeos/dbus/mock_dbus_thread_manager.cc |
@@ -35,10 +35,26 @@ |
using ::testing::AnyNumber; |
using ::testing::Return; |
using ::testing::ReturnNull; |
+using ::testing::SetArgumentPointee; |
using ::testing::_; |
namespace chromeos { |
+namespace { |
+ |
+std::vector<uint8>* GetMockSystemSalt() { |
+ static std::vector<uint8>* s_system_salt = NULL; |
+ if (!s_system_salt) { |
+ const char kStubSystemSalt[] = "stub_system_salt"; |
+ s_system_salt = new std::vector<uint8>(); |
+ s_system_salt->assign(kStubSystemSalt, |
+ kStubSystemSalt + arraysize(kStubSystemSalt) - 1); |
+ } |
+ return s_system_salt; |
+} |
+ |
+} // namespace |
+ |
MockDBusThreadManager::MockDBusThreadManager() |
: mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), |
mock_bluetooth_device_client_(new MockBluetoothDeviceClient), |
@@ -197,6 +213,10 @@ MockDBusThreadManager::MockDBusThreadManager() |
.Times(AnyNumber()); |
EXPECT_CALL(*mock_cryptohome_client_.get(), ResetAsyncCallStatusHandlers()) |
.Times(AnyNumber()); |
+ // Called from various locations. |
+ EXPECT_CALL(*mock_cryptohome_client_.get(), GetSystemSalt(_)) |
+ .WillRepeatedly(DoAll(SetArgumentPointee<0>(*GetMockSystemSalt()), |
+ Return(true))); |
// Called from BrightnessController::GetBrightnessPercent as part of ash tray |
// initialization. |