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

Unified Diff: chromeos/dbus/mock_cryptohome_client.cc

Issue 10817007: Remove chromeos::CryptohomeLibrary::IsMounted and convert (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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_cryptohome_client.cc
diff --git a/chromeos/dbus/mock_cryptohome_client.cc b/chromeos/dbus/mock_cryptohome_client.cc
index 6ef380d8c8e8a39c7fc9797d8b26443b097e6e62..56ac607dfb94a50b13057bf4f1530c6e4fdd0f43 100644
--- a/chromeos/dbus/mock_cryptohome_client.cc
+++ b/chromeos/dbus/mock_cryptohome_client.cc
@@ -4,9 +4,28 @@
#include "chromeos/dbus/mock_cryptohome_client.h"
+#include "base/bind.h"
+#include "base/message_loop.h"
+
+using ::testing::Invoke;
+using ::testing::_;
+
namespace chromeos {
-MockCryptohomeClient::MockCryptohomeClient() {}
+namespace {
+
+// Runs callback with true.
+void RunCallbackWithTrue(const CryptohomeClient::BoolMethodCallback& callback) {
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true));
+}
+
+} // namespace
+
+MockCryptohomeClient::MockCryptohomeClient() {
+ ON_CALL(*this, IsMounted(_))
+ .WillByDefault(Invoke(&RunCallbackWithTrue));
+}
MockCryptohomeClient::~MockCryptohomeClient() {}

Powered by Google App Engine
This is Rietveld 408576698