| OLD | NEW |
| 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/test/task_runner_test_template.h" | 5 #include "base/test/task_runner_test_template.h" |
| 6 | 6 |
| 7 namespace base { | 7 namespace base { |
| 8 | 8 |
| 9 namespace test { | 9 namespace test { |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 AutoLock lock(lock_); | 30 AutoLock lock(lock_); |
| 31 return task_run_counts_; | 31 return task_run_counts_; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void TaskTracker::WaitForCompletedTasks(int count) { | 34 void TaskTracker::WaitForCompletedTasks(int count) { |
| 35 AutoLock lock(lock_); | 35 AutoLock lock(lock_); |
| 36 while (task_runs_ < count) | 36 while (task_runs_ < count) |
| 37 task_runs_cv_.Wait(); | 37 task_runs_cv_.Wait(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void ExpectRunsTasksOnCurrentThread( | 40 void ExpectRunsTasksOnCurrentThread(bool expected_value, |
| 41 bool expected_value, | 41 TaskRunner* task_runner) { |
| 42 const scoped_refptr<TaskRunner>& task_runner) { | |
| 43 EXPECT_EQ(expected_value, task_runner->RunsTasksOnCurrentThread()); | 42 EXPECT_EQ(expected_value, task_runner->RunsTasksOnCurrentThread()); |
| 44 } | 43 } |
| 45 | 44 |
| 46 } // namespace test | 45 } // namespace test |
| 47 | 46 |
| 48 } // namespace base | 47 } // namespace base |
| OLD | NEW |