Skip to content

Commit

Permalink
Threading: Remove TaskRunnerHandlesNonZeroDelays from TaskRunnerTestD…
Browse files Browse the repository at this point in the history
…elegate

This is no longer necessary (always returns true).


BUG=149144
TEST=n/a (no behavioral changes)

Review URL: https://codereview.chromium.org/146833008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247393 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
nhiroki@chromium.org committed Jan 28, 2014
1 parent f21850a commit 8853f01
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 57 deletions.
35 changes: 0 additions & 35 deletions base/test/sequenced_task_runner_test_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ TYPED_TEST_P(SequencedTaskRunnerTest, SequentialNestable) {
// that that the tasks are run in FIFO order and that there is no execution
// overlap whatsoever between any two tasks.
TYPED_TEST_P(SequencedTaskRunnerTest, SequentialDelayedNonNestable) {
// TODO(akalin): Remove this check (http://crbug.com/149144).
if (!this->delegate_.TaskRunnerHandlesNonZeroDelays()) {
DLOG(INFO) << "This SequencedTaskRunner doesn't handle "
"non-zero delays; skipping";
return;
}

const int kTaskCount = 20;
const int kDelayIncrementMs = 50;

Expand Down Expand Up @@ -236,13 +229,6 @@ TYPED_TEST_P(SequencedTaskRunnerTest, NonNestablePostFromNonNestableTask) {
// This test posts a delayed task, and checks that the task is run later than
// the specified time.
TYPED_TEST_P(SequencedTaskRunnerTest, DelayedTaskBasic) {
// TODO(akalin): Remove this check (http://crbug.com/149144).
if (!this->delegate_.TaskRunnerHandlesNonZeroDelays()) {
DLOG(INFO) << "This SequencedTaskRunner doesn't handle "
"non-zero delays; skipping";
return;
}

const int kTaskCount = 1;
const TimeDelta kDelay = TimeDelta::FromMilliseconds(100);

Expand Down Expand Up @@ -270,13 +256,6 @@ TYPED_TEST_P(SequencedTaskRunnerTest, DelayedTaskBasic) {
// posted at the exact same time. It would be nice if the API allowed us to
// specify the desired run time.
TYPED_TEST_P(SequencedTaskRunnerTest, DelayedTasksSameDelay) {
// TODO(akalin): Remove this check (http://crbug.com/149144).
if (!this->delegate_.TaskRunnerHandlesNonZeroDelays()) {
DLOG(INFO) << "This SequencedTaskRunner doesn't handle "
"non-zero delays; skipping";
return;
}

const int kTaskCount = 2;
const TimeDelta kDelay = TimeDelta::FromMilliseconds(100);

Expand All @@ -299,13 +278,6 @@ TYPED_TEST_P(SequencedTaskRunnerTest, DelayedTasksSameDelay) {
// delayed task runs after the normal task even if the normal task takes
// a long time to run.
TYPED_TEST_P(SequencedTaskRunnerTest, DelayedTaskAfterLongTask) {
// TODO(akalin): Remove this check (http://crbug.com/149144).
if (!this->delegate_.TaskRunnerHandlesNonZeroDelays()) {
DLOG(INFO) << "This SequencedTaskRunner doesn't handle "
"non-zero delays; skipping";
return;
}

const int kTaskCount = 2;

this->delegate_.StartTaskRunner();
Expand All @@ -327,13 +299,6 @@ TYPED_TEST_P(SequencedTaskRunnerTest, DelayedTaskAfterLongTask) {
// Test that a pile of normal tasks and a delayed task run in the
// time-to-run order.
TYPED_TEST_P(SequencedTaskRunnerTest, DelayedTaskAfterManyLongTasks) {
// TODO(akalin): Remove this check (http://crbug.com/149144).
if (!this->delegate_.TaskRunnerHandlesNonZeroDelays()) {
DLOG(INFO) << "This SequencedTaskRunner doesn't handle "
"non-zero delays; skipping";
return;
}

const int kTaskCount = 11;

this->delegate_.StartTaskRunner();
Expand Down
10 changes: 0 additions & 10 deletions base/test/task_runner_test_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
// void StopTaskRunner() {
// ...
// }
//
// // Returns whether or not the task runner obeys non-zero delays.
// bool TaskRunnerHandlesNonZeroDelays() const {
// return true;
// }
// };
//
// The TaskRunnerTest test harness will have a member variable of
Expand Down Expand Up @@ -141,11 +136,6 @@ TYPED_TEST_P(TaskRunnerTest, Basic) {
// Post a bunch of delayed tasks to the task runner. They should all
// complete.
TYPED_TEST_P(TaskRunnerTest, Delayed) {
if (!this->delegate_.TaskRunnerHandlesNonZeroDelays()) {
DLOG(INFO) << "This TaskRunner doesn't handle non-zero delays; skipping";
return;
}

std::map<int, int> expected_task_run_counts;
int expected_total_tasks = 0;

Expand Down
12 changes: 0 additions & 12 deletions base/threading/sequenced_worker_pool_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,6 @@ class SequencedWorkerPoolTaskRunnerTestDelegate {
// reference to the pool.
}

bool TaskRunnerHandlesNonZeroDelays() const {
return true;
}

private:
MessageLoop message_loop_;
scoped_ptr<SequencedWorkerPoolOwner> pool_owner_;
Expand Down Expand Up @@ -872,10 +868,6 @@ class SequencedWorkerPoolTaskRunnerWithShutdownBehaviorTestDelegate {
// reference to the pool.
}

bool TaskRunnerHandlesNonZeroDelays() const {
return true;
}

private:
MessageLoop message_loop_;
scoped_ptr<SequencedWorkerPoolOwner> pool_owner_;
Expand Down Expand Up @@ -913,10 +905,6 @@ class SequencedWorkerPoolSequencedTaskRunnerTestDelegate {
// reference to the pool.
}

bool TaskRunnerHandlesNonZeroDelays() const {
return true;
}

private:
MessageLoop message_loop_;
scoped_ptr<SequencedWorkerPoolOwner> pool_owner_;
Expand Down

0 comments on commit 8853f01

Please sign in to comment.