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

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

Issue 2031923003: Remove use of deprecated MessageLoop methods in chromeos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « chromeos/dbus/fake_cryptohome_client.cc ('k') | chromeos/login/auth/login_performer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h"
9 11
10 using ::testing::_; 12 using ::testing::_;
11 using ::testing::AnyNumber; 13 using ::testing::AnyNumber;
12 using ::testing::Invoke; 14 using ::testing::Invoke;
13 15
14 namespace chromeos { 16 namespace chromeos {
15 17
16 namespace { 18 namespace {
17 19
18 // Runs callback with true. 20 // Runs callback with true.
19 void RunCallbackWithTrue(const BoolDBusMethodCallback& callback) { 21 void RunCallbackWithTrue(const BoolDBusMethodCallback& callback) {
20 base::MessageLoop::current()->PostTask( 22 base::ThreadTaskRunnerHandle::Get()->PostTask(
21 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true)); 23 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true));
22 } 24 }
23 25
24 } // namespace 26 } // namespace
25 27
26 MockCryptohomeClient::MockCryptohomeClient() { 28 MockCryptohomeClient::MockCryptohomeClient() {
27 EXPECT_CALL(*this, Init(_)).Times(AnyNumber()); 29 EXPECT_CALL(*this, Init(_)).Times(AnyNumber());
28 ON_CALL(*this, IsMounted(_)) 30 ON_CALL(*this, IsMounted(_))
29 .WillByDefault(Invoke(&RunCallbackWithTrue)); 31 .WillByDefault(Invoke(&RunCallbackWithTrue));
30 ON_CALL(*this, InstallAttributesIsReady(_)) 32 ON_CALL(*this, InstallAttributesIsReady(_))
31 .WillByDefault(Invoke(&RunCallbackWithTrue)); 33 .WillByDefault(Invoke(&RunCallbackWithTrue));
32 } 34 }
33 35
34 MockCryptohomeClient::~MockCryptohomeClient() {} 36 MockCryptohomeClient::~MockCryptohomeClient() {}
35 37
36 } // namespace chromeos 38 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_cryptohome_client.cc ('k') | chromeos/login/auth/login_performer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698