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

Side by Side Diff: net/base/test_completion_callback_unittest.cc

Issue 19614003: Use a direct include of the message_loop header in net/, part 1. (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
« no previous file with comments | « net/base/test_completion_callback.cc ('k') | net/base/upload_data_stream_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Illustrates how to use worker threads that issue completion callbacks 5 // Illustrates how to use worker threads that issue completion callbacks
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/threading/worker_pool.h" 10 #include "base/threading/worker_pool.h"
11 #include "net/base/completion_callback.h" 11 #include "net/base/completion_callback.h"
12 #include "net/base/test_completion_callback.h" 12 #include "net/base/test_completion_callback.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "testing/platform_test.h" 14 #include "testing/platform_test.h"
15 15
16 typedef PlatformTest TestCompletionCallbackTest; 16 typedef PlatformTest TestCompletionCallbackTest;
17 17
18 const int kMagicResult = 8888; 18 const int kMagicResult = 8888;
19 19
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 TEST_F(TestCompletionCallbackTest, Simple) { 114 TEST_F(TestCompletionCallbackTest, Simple) {
115 ExampleEmployer boss; 115 ExampleEmployer boss;
116 net::TestCompletionCallback callback; 116 net::TestCompletionCallback callback;
117 bool queued = boss.DoSomething(callback.callback()); 117 bool queued = boss.DoSomething(callback.callback());
118 EXPECT_EQ(queued, true); 118 EXPECT_EQ(queued, true);
119 int result = callback.WaitForResult(); 119 int result = callback.WaitForResult();
120 EXPECT_EQ(result, kMagicResult); 120 EXPECT_EQ(result, kMagicResult);
121 } 121 }
122 122
123 // TODO: test deleting ExampleEmployer while work outstanding 123 // TODO: test deleting ExampleEmployer while work outstanding
OLDNEW
« no previous file with comments | « net/base/test_completion_callback.cc ('k') | net/base/upload_data_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698