| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 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 | 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/platform_test.h" | |
| 6 #include "base/task.h" | 5 #include "base/task.h" |
| 7 #include "base/waitable_event.h" | 6 #include "base/waitable_event.h" |
| 8 #include "base/worker_pool.h" | 7 #include "base/worker_pool.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "testing/platform_test.h" |
| 10 | 10 |
| 11 using base::WaitableEvent; | 11 using base::WaitableEvent; |
| 12 | 12 |
| 13 typedef PlatformTest WorkerPoolTest; | 13 typedef PlatformTest WorkerPoolTest; |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 class PostTaskTestTask : public Task { | 17 class PostTaskTestTask : public Task { |
| 18 public: | 18 public: |
| 19 PostTaskTestTask(WaitableEvent* event) : event_(event) { | 19 PostTaskTestTask(WaitableEvent* event) : event_(event) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&test_event), false); | 35 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&test_event), false); |
| 36 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&long_test_event), true); | 36 WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&long_test_event), true); |
| 37 | 37 |
| 38 signaled = test_event.Wait(); | 38 signaled = test_event.Wait(); |
| 39 EXPECT_TRUE(signaled); | 39 EXPECT_TRUE(signaled); |
| 40 signaled = long_test_event.Wait(); | 40 signaled = long_test_event.Wait(); |
| 41 EXPECT_TRUE(signaled); | 41 EXPECT_TRUE(signaled); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| OLD | NEW |