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

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

Issue 6341004: More net/ reordering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Window gyp dependency Created 9 years, 11 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/http/http_auth_handler_factory.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/logging.h"
8 #include "base/message_loop.h"
9 #include "base/task.h"
7 #include "base/threading/worker_pool.h" 10 #include "base/threading/worker_pool.h"
8 #include "net/base/completion_callback.h" 11 #include "net/base/completion_callback.h"
9 #include "net/base/test_completion_callback.h" 12 #include "net/base/test_completion_callback.h"
10 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
11 #include "testing/platform_test.h" 14 #include "testing/platform_test.h"
12 15
13 typedef PlatformTest TestCompletionCallbackTest; 16 typedef PlatformTest TestCompletionCallbackTest;
14 17
15 using net::CompletionCallback; 18 using net::CompletionCallback;
16 19
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 TEST_F(TestCompletionCallbackTest, Simple) { 118 TEST_F(TestCompletionCallbackTest, Simple) {
116 ExampleEmployer boss; 119 ExampleEmployer boss;
117 TestCompletionCallback callback; 120 TestCompletionCallback callback;
118 bool queued = boss.DoSomething(&callback); 121 bool queued = boss.DoSomething(&callback);
119 EXPECT_EQ(queued, true); 122 EXPECT_EQ(queued, true);
120 int result = callback.WaitForResult(); 123 int result = callback.WaitForResult();
121 EXPECT_EQ(result, kMagicResult); 124 EXPECT_EQ(result, kMagicResult);
122 } 125 }
123 126
124 // TODO: test deleting ExampleEmployer while work outstanding 127 // TODO: test deleting ExampleEmployer while work outstanding
OLDNEW
« no previous file with comments | « net/base/test_completion_callback.cc ('k') | net/http/http_auth_handler_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698