Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / chromeos / dbus / mock_cryptohome_client.cc
blob60927c14b2adeebfb9c5efa971b268fb2ff73d3f
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromeos/dbus/mock_cryptohome_client.h"
7 #include "base/bind.h"
8 #include "base/message_loop.h"
10 using ::testing::Invoke;
11 using ::testing::_;
13 namespace chromeos {
15 namespace {
17 // Runs callback with true.
18 void RunCallbackWithTrue(const BoolDBusMethodCallback& callback) {
19 MessageLoop::current()->PostTask(
20 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true));
23 } // namespace
25 MockCryptohomeClient::MockCryptohomeClient() {
26 ON_CALL(*this, IsMounted(_))
27 .WillByDefault(Invoke(&RunCallbackWithTrue));
28 ON_CALL(*this, InstallAttributesIsReady(_))
29 .WillByDefault(Invoke(&RunCallbackWithTrue));
32 MockCryptohomeClient::~MockCryptohomeClient() {}
34 } // namespace chromeos