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

Side by Side Diff: base/test/sequenced_task_runner_test_template.h

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | base/test/task_runner_test_template.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // SequencedTaskRunnerTest defines tests that implementations of 5 // SequencedTaskRunnerTest defines tests that implementations of
6 // SequencedTaskRunner should pass in order to be conformant. 6 // SequencedTaskRunner should pass in order to be conformant.
7 // See task_runner_test_template.h for a description of how to use the 7 // See task_runner_test_template.h for a description of how to use the
8 // constructs in this file; these work the same. 8 // constructs in this file; these work the same.
9 9
10 #ifndef BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_ 10 #ifndef BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 const int kChildrenPerParent = 10; 204 const int kChildrenPerParent = 10;
205 205
206 this->delegate_.StartTaskRunner(); 206 this->delegate_.StartTaskRunner();
207 const scoped_refptr<SequencedTaskRunner> task_runner = 207 const scoped_refptr<SequencedTaskRunner> task_runner =
208 this->delegate_.GetTaskRunner(); 208 this->delegate_.GetTaskRunner();
209 209
210 for (int i = 0; i < kParentCount; ++i) { 210 for (int i = 0; i < kParentCount; ++i) {
211 Closure task = Bind( 211 Closure task = Bind(
212 &internal::SequencedTaskTracker::PostNonNestableTasks, 212 &internal::SequencedTaskTracker::PostNonNestableTasks,
213 this->task_tracker_, 213 this->task_tracker_,
214 task_runner, 214 RetainedRef(task_runner),
215 kChildrenPerParent); 215 kChildrenPerParent);
216 this->task_tracker_->PostWrappedNonNestableTask(task_runner.get(), task); 216 this->task_tracker_->PostWrappedNonNestableTask(task_runner.get(), task);
217 } 217 }
218 218
219 this->delegate_.StopTaskRunner(); 219 this->delegate_.StopTaskRunner();
220 220
221 EXPECT_TRUE(CheckNonNestableInvariants( 221 EXPECT_TRUE(CheckNonNestableInvariants(
222 this->task_tracker_->GetTaskEvents(), 222 this->task_tracker_->GetTaskEvents(),
223 kParentCount * (kChildrenPerParent + 1))); 223 kParentCount * (kChildrenPerParent + 1)));
224 } 224 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 341 }
342 342
343 // SequencedTaskRunnerDelayedTest tests that the |delay| parameter of 343 // SequencedTaskRunnerDelayedTest tests that the |delay| parameter of
344 // is used to actually wait for |delay| ms before executing the task. 344 // is used to actually wait for |delay| ms before executing the task.
345 // This is not mandatory for a SequencedTaskRunner to be compliant. 345 // This is not mandatory for a SequencedTaskRunner to be compliant.
346 REGISTER_TYPED_TEST_CASE_P(SequencedTaskRunnerDelayedTest, DelayedTaskBasic); 346 REGISTER_TYPED_TEST_CASE_P(SequencedTaskRunnerDelayedTest, DelayedTaskBasic);
347 347
348 } // namespace base 348 } // namespace base
349 349
350 #endif // BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_ 350 #endif // BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_
OLDNEW
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | base/test/task_runner_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698