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

Unified Diff: components/policy/core/common/cloud/external_policy_data_updater_unittest.cc

Issue 2331423002: Replace TestSimpleTaskRunner::GetPendingTasks with TakePendingTasks (Closed)
Patch Set: split test Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/cloud/external_policy_data_updater_unittest.cc
diff --git a/components/policy/core/common/cloud/external_policy_data_updater_unittest.cc b/components/policy/core/common/cloud/external_policy_data_updater_unittest.cc
index e57e2bec3edd882cdcc9972705c8e4ae64abae57..6e95ba972e40ab9de24c354d0d842b582c1a3409 100644
--- a/components/policy/core/common/cloud/external_policy_data_updater_unittest.cc
+++ b/components/policy/core/common/cloud/external_policy_data_updater_unittest.cc
@@ -352,12 +352,11 @@ TEST_F(ExternalPolicyDataUpdaterTest, RetryWithBackoff) {
// Verify that the retry delay has been doubled, with random jitter from 80%
// to 100%.
- const base::TestPendingTask task =
- backend_task_runner_->GetPendingTasks().front();
- EXPECT_GT(task.delay,
+ base::TimeDelta delay = backend_task_runner_->NextPendingTaskDelay();
+ EXPECT_GT(delay,
base::TimeDelta::FromMilliseconds(
0.799 * expected_delay.InMilliseconds()));
- EXPECT_LE(task.delay, expected_delay);
+ EXPECT_LE(delay, expected_delay);
if (i < 10) {
// The delay cap has not been reached yet.

Powered by Google App Engine
This is Rietveld 408576698