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

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

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 years, 8 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
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/blocking_method_caller.h" 5 #include "chromeos/dbus/blocking_method_caller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 10 matching lines...) Expand all
21 using ::testing::Invoke; 21 using ::testing::Invoke;
22 using ::testing::Return; 22 using ::testing::Return;
23 23
24 namespace chromeos { 24 namespace chromeos {
25 25
26 namespace { 26 namespace {
27 27
28 class FakeTaskRunner : public base::TaskRunner { 28 class FakeTaskRunner : public base::TaskRunner {
29 public: 29 public:
30 bool PostDelayedTask(const tracked_objects::Location& from_here, 30 bool PostDelayedTask(const tracked_objects::Location& from_here,
31 base::Closure task, 31 base::OnceClosure task,
32 base::TimeDelta delay) override { 32 base::TimeDelta delay) override {
33 std::move(task).Run(); 33 std::move(task).Run();
34 return true; 34 return true;
35 } 35 }
36 bool RunsTasksOnCurrentThread() const override { return true; } 36 bool RunsTasksOnCurrentThread() const override { return true; }
37 37
38 protected: 38 protected:
39 ~FakeTaskRunner() override {} 39 ~FakeTaskRunner() override {}
40 }; 40 };
41 41
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // Check the response. 130 // Check the response.
131 ASSERT_TRUE(response.get()); 131 ASSERT_TRUE(response.get());
132 dbus::MessageReader reader(response.get()); 132 dbus::MessageReader reader(response.get());
133 std::string text_message; 133 std::string text_message;
134 ASSERT_TRUE(reader.PopString(&text_message)); 134 ASSERT_TRUE(reader.PopString(&text_message));
135 // The text message should be echo'ed back. 135 // The text message should be echo'ed back.
136 EXPECT_EQ(kHello, text_message); 136 EXPECT_EQ(kHello, text_message);
137 } 137 }
138 138
139 } // namespace chromeos 139 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromecast/base/system_time_change_notifier_unittest.cc ('k') | chromeos/tpm/tpm_token_info_getter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698