blob: 49ec3929546219243eadbf5d14646be77d5abbaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/dbus/mock_cryptohome_client.h"
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
using ::testing::Invoke;
using ::testing::_;
namespace chromeos {
namespace {
// Runs callback with true.
void RunCallbackWithTrue(const BoolDBusMethodCallback& callback) {
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true));
}
} // namespace
MockCryptohomeClient::MockCryptohomeClient() {
ON_CALL(*this, IsMounted(_))
.WillByDefault(Invoke(&RunCallbackWithTrue));
ON_CALL(*this, InstallAttributesIsReady(_))
.WillByDefault(Invoke(&RunCallbackWithTrue));
}
MockCryptohomeClient::~MockCryptohomeClient() {}
} // namespace chromeos
|