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

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

Issue 13052: Cleanup: move base/platform_test.h -> testing/ (Closed)
Patch Set: fix mark's comment Created 12 years 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
« no previous file with comments | « net/base/telnet_server_unittest.cc ('k') | net/disk_cache/disk_cache_perftest.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "net/base/completion_callback.h" 8 #include "net/base/completion_callback.h"
9 #include "net/base/test_completion_callback.h" 9 #include "net/base/test_completion_callback.h"
10 #include "base/platform_test.h"
11 #include "base/worker_pool.h" 10 #include "base/worker_pool.h"
11 #include "testing/platform_test.h"
12 12
13 typedef PlatformTest TestCompletionCallbackTest; 13 typedef PlatformTest TestCompletionCallbackTest;
14 14
15 using net::CompletionCallback; 15 using net::CompletionCallback;
16 16
17 const int kMagicResult = 8888; 17 const int kMagicResult = 8888;
18 18
19 // ExampleEmployer is a toy version of HostResolver 19 // ExampleEmployer is a toy version of HostResolver
20 // TODO: restore damage done in extracting example from real code 20 // TODO: restore damage done in extracting example from real code
21 // (e.g. bring back real destructor, bring back comments) 21 // (e.g. bring back real destructor, bring back comments)
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 TEST_F(TestCompletionCallbackTest, Simple) { 111 TEST_F(TestCompletionCallbackTest, Simple) {
112 ExampleEmployer boss; 112 ExampleEmployer boss;
113 TestCompletionCallback callback; 113 TestCompletionCallback callback;
114 bool queued = boss.DoSomething(&callback); 114 bool queued = boss.DoSomething(&callback);
115 EXPECT_EQ(queued, true); 115 EXPECT_EQ(queued, true);
116 int result = callback.WaitForResult(); 116 int result = callback.WaitForResult();
117 EXPECT_EQ(result, kMagicResult); 117 EXPECT_EQ(result, kMagicResult);
118 } 118 }
119 119
120 // TODO: test deleting ExampleEmployer while work outstanding 120 // TODO: test deleting ExampleEmployer while work outstanding
OLDNEW
« no previous file with comments | « net/base/telnet_server_unittest.cc ('k') | net/disk_cache/disk_cache_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698