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

Side by Side Diff: base/task_runner_util_unittest.cc

Issue 9416060: Move PostTaskAndReplyWithStatus into task_runner_helpers.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed copyright header Created 8 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 | Annotate | Revision Log
« no previous file with comments | « base/task_runner_util.h ('k') | chrome/browser/extensions/api/declarative/declarative_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_util.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 PostTaskAndReplyWithResult(
30 message_loop.message_loop_proxy(),
31 FROM_HERE,
32 Bind(&ReturnFourtyTwo),
33 Bind(&StoreValue, &result));
34
35 message_loop.RunAllPending();
36
37 EXPECT_EQ(42, result);
38 }
39
40 } // namespace base
OLDNEW
« no previous file with comments | « base/task_runner_util.h ('k') | chrome/browser/extensions/api/declarative/declarative_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698