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

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

Issue 8221021: Modify WaitableEvent::Wait() to return void (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment and style Created 9 years, 2 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
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 #include "base/threading/worker_pool.h" 5 #include "base/threading/worker_pool.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 16 matching lines...) Expand all
27 27
28 private: 28 private:
29 WaitableEvent* event_; 29 WaitableEvent* event_;
30 }; 30 };
31 31
32 } // namespace 32 } // namespace
33 33
34 TEST_F(WorkerPoolTest, PostTask) { 34 TEST_F(WorkerPoolTest, PostTask) {
35 WaitableEvent test_event(false, false); 35 WaitableEvent test_event(false, false);
36 WaitableEvent long_test_event(false, false); 36 WaitableEvent long_test_event(false, false);
37 bool signaled;
38 37
39 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&test_event), false); 38 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&test_event), false);
40 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&long_test_event), true); 39 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&long_test_event), true);
41 40
42 signaled = test_event.Wait(); 41 test_event.Wait();
43 EXPECT_TRUE(signaled); 42 long_test_event.Wait();
44 signaled = long_test_event.Wait();
45 EXPECT_TRUE(signaled);
46 } 43 }
47 44
48 } // namespace base 45 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/worker_pool_posix_unittest.cc ('k') | chrome/browser/extensions/test_extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698