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

Side by Side Diff: base/threading/worker_pool_unittest.cc

Issue 10694131: Switch to TimeDelta interface for process waiting functions in base. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « base/process_util_win.cc ('k') | base/win/sampling_profiler_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) 2012 The Chromium Authors. All rights reserved. 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 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 #include "base/threading/worker_pool.h" 5 #include "base/threading/worker_pool.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 #define MAYBE_PostTaskAndReply DISABLED_PostTaskAndReply 88 #define MAYBE_PostTaskAndReply DISABLED_PostTaskAndReply
89 #else 89 #else
90 #define MAYBE_PostTaskAndReply PostTaskAndReply 90 #define MAYBE_PostTaskAndReply PostTaskAndReply
91 #endif 91 #endif
92 92
93 TEST_F(WorkerPoolTest, MAYBE_PostTaskAndReply) { 93 TEST_F(WorkerPoolTest, MAYBE_PostTaskAndReply) {
94 MessageLoop message_loop; 94 MessageLoop message_loop;
95 scoped_refptr<PostTaskAndReplyTester> tester(new PostTaskAndReplyTester()); 95 scoped_refptr<PostTaskAndReplyTester> tester(new PostTaskAndReplyTester());
96 tester->RunTest(); 96 tester->RunTest();
97 97
98 const TimeDelta kMaxDuration = 98 const TimeDelta kMaxDuration = TestTimeouts::tiny_timeout();
99 TimeDelta::FromMilliseconds(TestTimeouts::tiny_timeout_ms());
100 TimeTicks start = TimeTicks::Now(); 99 TimeTicks start = TimeTicks::Now();
101 while (!tester->finished() && TimeTicks::Now() - start < kMaxDuration) { 100 while (!tester->finished() && TimeTicks::Now() - start < kMaxDuration) {
102 MessageLoop::current()->RunAllPending(); 101 MessageLoop::current()->RunAllPending();
103 } 102 }
104 EXPECT_TRUE(tester->finished()); 103 EXPECT_TRUE(tester->finished());
105 } 104 }
106 105
107 } // namespace base 106 } // namespace base
OLDNEW
« no previous file with comments | « base/process_util_win.cc ('k') | base/win/sampling_profiler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698