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

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

Issue 6079009: Move some misc thread-related stuff from base to base/thread and into the bas... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 | « base/threading/worker_pool_posix_unittest.cc ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2008 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.h"
6 #include "base/waitable_event.h"
7 #include "base/threading/worker_pool.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/platform_test.h"
10
11 typedef PlatformTest WorkerPoolTest;
12
13 namespace base {
14
15 namespace {
16
17 class PostTaskTestTask : public Task {
18 public:
19 explicit PostTaskTestTask(WaitableEvent* event) : event_(event) {
20 }
21
22 void Run() {
23 event_->Signal();
24 }
25
26 private:
27 WaitableEvent* event_;
28 };
29
30 } // namespace
31
32 TEST_F(WorkerPoolTest, PostTask) {
33 WaitableEvent test_event(false, false);
34 WaitableEvent long_test_event(false, false);
35 bool signaled;
36
37 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&test_event), false);
38 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&long_test_event), true);
39
40 signaled = test_event.Wait();
41 EXPECT_TRUE(signaled);
42 signaled = long_test_event.Wait();
43 EXPECT_TRUE(signaled);
44 }
45
46 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/worker_pool_posix_unittest.cc ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698