From 89726c2516dfc9ca5dc4cc23acff4841608ad97c Mon Sep 17 00:00:00 2001 From: engedy Date: Mon, 2 Feb 2015 02:57:37 -0800 Subject: Implement throttling logic for fetching affiliation information. BUG=437865 Review URL: https://codereview.chromium.org/807503002 Cr-Commit-Position: refs/heads/master@{#314127} --- base/test/test_mock_time_task_runner.cc | 5 +++++ base/test/test_mock_time_task_runner.h | 1 + 2 files changed, 6 insertions(+) (limited to 'base/test') diff --git a/base/test/test_mock_time_task_runner.cc b/base/test/test_mock_time_task_runner.cc index 1698391..442d991 100644 --- a/base/test/test_mock_time_task_runner.cc +++ b/base/test/test_mock_time_task_runner.cc @@ -102,6 +102,11 @@ bool TestMockTimeTaskRunner::HasPendingTask() const { return !tasks_.empty(); } +size_t TestMockTimeTaskRunner::GetPendingTaskCount() const { + DCHECK(thread_checker_.CalledOnValidThread()); + return tasks_.size(); +} + TimeDelta TestMockTimeTaskRunner::NextPendingTaskDelay() const { DCHECK(thread_checker_.CalledOnValidThread()); return tasks_.empty() ? TimeDelta::Max() : tasks_.top().GetTimeToRun() - now_; diff --git a/base/test/test_mock_time_task_runner.h b/base/test/test_mock_time_task_runner.h index 3a0a215..2f59892 100644 --- a/base/test/test_mock_time_task_runner.h +++ b/base/test/test_mock_time_task_runner.h @@ -60,6 +60,7 @@ class TestMockTimeTaskRunner : public base::SingleThreadTaskRunner { scoped_ptr GetMockTickClock() const; bool HasPendingTask() const; + size_t GetPendingTaskCount() const; TimeDelta NextPendingTaskDelay() const; // SingleThreadTaskRunner: -- cgit v1.1