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

Side by Side Diff: base/task_runner_unittest.cc

Issue 9416060: Move PostTaskAndReplyWithStatus into task_runner_helpers.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 9 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
(Empty)
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.
4
5 #include "base/task_runner.h"
6
7 #include "base/bind.h"
8 #include "base/message_loop.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace base {
12
13 namespace {
14
15 int ReturnFourtyTwo() {
16 return 42;
17 }
18
19 void StoreValue(int* destination, int value) {
20 *destination = value;
21 }
22
23 } // namespace
24
25 TEST(TaskRunnerHelpersTest, PostAndReplyWithStatus) {
26 MessageLoop message_loop;
27 int result = 0;
28
29 message_loop.message_loop_proxy()->PostTaskAndReplyWithResult(
30 FROM_HERE,
31 Bind(&ReturnFourtyTwo),
32 Bind(&StoreValue, &result));
33
34 message_loop.RunAllPending();
35
36 EXPECT_EQ(42, result);
37 }
38
39 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698