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

Side by Side Diff: chromeos/dbus/mock_cryptohome_client.cc

Issue 19468003: Use a direct include of the message_loop header in chromeos/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/mock_cryptohome_client.h" 5 #include "chromeos/dbus/mock_cryptohome_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 9
10 using ::testing::Invoke; 10 using ::testing::Invoke;
11 using ::testing::_; 11 using ::testing::_;
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 namespace { 15 namespace {
16 16
17 // Runs callback with true. 17 // Runs callback with true.
18 void RunCallbackWithTrue(const BoolDBusMethodCallback& callback) { 18 void RunCallbackWithTrue(const BoolDBusMethodCallback& callback) {
19 base::MessageLoop::current()->PostTask( 19 base::MessageLoop::current()->PostTask(
20 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true)); 20 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true));
21 } 21 }
22 22
23 } // namespace 23 } // namespace
24 24
25 MockCryptohomeClient::MockCryptohomeClient() { 25 MockCryptohomeClient::MockCryptohomeClient() {
26 ON_CALL(*this, IsMounted(_)) 26 ON_CALL(*this, IsMounted(_))
27 .WillByDefault(Invoke(&RunCallbackWithTrue)); 27 .WillByDefault(Invoke(&RunCallbackWithTrue));
28 ON_CALL(*this, InstallAttributesIsReady(_)) 28 ON_CALL(*this, InstallAttributesIsReady(_))
29 .WillByDefault(Invoke(&RunCallbackWithTrue)); 29 .WillByDefault(Invoke(&RunCallbackWithTrue));
30 } 30 }
31 31
32 MockCryptohomeClient::~MockCryptohomeClient() {} 32 MockCryptohomeClient::~MockCryptohomeClient() {}
33 33
34 } // namespace chromeos 34 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/ibus/ibus_panel_service_unittest.cc ('k') | chromeos/dbus/modem_messaging_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698