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

Side by Side Diff: base/test/task_runner_test_template.cc

Issue 1705943002: TaskScheduler [5/9] Task Tracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s_3_pq
Patch Set: fix PostTask comment Created 4 years, 9 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
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/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 internal { 9 namespace testing {
10 10
11 TaskTracker::TaskTracker() : task_runs_(0), task_runs_cv_(&lock_) {} 11 TaskTracker::TaskTracker() : task_runs_(0), task_runs_cv_(&lock_) {}
12 12
13 TaskTracker::~TaskTracker() {} 13 TaskTracker::~TaskTracker() {}
14 14
15 Closure TaskTracker::WrapTask(const Closure& task, int i) { 15 Closure TaskTracker::WrapTask(const Closure& task, int i) {
16 return Bind(&TaskTracker::RunTask, this, task, i); 16 return Bind(&TaskTracker::RunTask, this, task, i);
17 } 17 }
18 18
19 void TaskTracker::RunTask(const Closure& task, int i) { 19 void TaskTracker::RunTask(const Closure& task, int i) {
(...skipping 16 matching lines...) Expand all
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(
41 bool expected_value, 41 bool expected_value,
42 const scoped_refptr<TaskRunner>& task_runner) { 42 const scoped_refptr<TaskRunner>& task_runner) {
43 EXPECT_EQ(expected_value, task_runner->RunsTasksOnCurrentThread()); 43 EXPECT_EQ(expected_value, task_runner->RunsTasksOnCurrentThread());
44 } 44 }
45 45
46 } // namespace internal 46 } // namespace testing
47 47
48 } // namespace base 48 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698