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

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

Issue 375933002: Remove cloud policy refresh rate limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/cloud_policy_refresh_scheduler_unittest.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc
index 63149fced6d7eab0274d956bb1c88d1f98e73e7c..d0f86714cd8c8f65b02a13ce3943f99963111672 100644
--- a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc
@@ -193,19 +193,11 @@ TEST_F(CloudPolicyRefreshSchedulerTest, Unregistered) {
EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
}
-TEST_F(CloudPolicyRefreshSchedulerTest, RefreshSoonRateLimit) {
+TEST_F(CloudPolicyRefreshSchedulerTest, RefreshSoon) {
scoped_ptr<CloudPolicyRefreshScheduler> scheduler(CreateRefreshScheduler());
- // Max out the request rate.
- for (int i = 0; i < 5; ++i) {
- EXPECT_CALL(client_, FetchPolicy()).Times(1);
- scheduler->RefreshSoon();
- task_runner_->RunUntilIdle();
- Mock::VerifyAndClearExpectations(&client_);
- }
- // The next refresh is throttled.
- EXPECT_CALL(client_, FetchPolicy()).Times(0);
+ EXPECT_CALL(client_, FetchPolicy()).Times(1);
scheduler->RefreshSoon();
- task_runner_->RunPendingTasks();
+ task_runner_->RunUntilIdle();
Mock::VerifyAndClearExpectations(&client_);
}

Powered by Google App Engine
This is Rietveld 408576698