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

Unified Diff: chromeos/dbus/mock_dbus_thread_manager.cc

Issue 14179007: Move cryptohome_library to src/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
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.
« chromeos/cryptohome/cryptohome_library.cc ('K') | « chromeos/cryptohome/mock_cryptohome_library.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698