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

Unified Diff: chrome/browser/chromeos/policy/status_uploader_unittest.cc

Issue 1963703002: Add delay when scheduling next status upload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change tests to match the new behavior Created 4 years, 7 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
« no previous file with comments | « chrome/browser/chromeos/policy/status_uploader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/status_uploader_unittest.cc
diff --git a/chrome/browser/chromeos/policy/status_uploader_unittest.cc b/chrome/browser/chromeos/policy/status_uploader_unittest.cc
index 8251fd26f4a3c8aff6a746c1754aaf7e9f6ba14d..cdb52d6fc827c646f1e68b5d89d434218abd0c9c 100644
--- a/chrome/browser/chromeos/policy/status_uploader_unittest.cc
+++ b/chrome/browser/chromeos/policy/status_uploader_unittest.cc
@@ -142,8 +142,9 @@ TEST_F(StatusUploaderTest, BasicTest) {
EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
StatusUploader uploader(&client_, std::move(collector_), task_runner_);
EXPECT_EQ(1U, task_runner_->GetPendingTasks().size());
- // On startup, first update should happen immediately.
- EXPECT_EQ(base::TimeDelta(), task_runner_->NextPendingTaskDelay());
+ // On startup, first update should happen in 1 minute.
+ EXPECT_EQ(base::TimeDelta::FromMinutes(1),
+ task_runner_->NextPendingTaskDelay());
}
TEST_F(StatusUploaderTest, DifferentFrequencyAtStart) {
@@ -157,8 +158,9 @@ TEST_F(StatusUploaderTest, DifferentFrequencyAtStart) {
EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
StatusUploader uploader(&client_, std::move(collector_), task_runner_);
ASSERT_EQ(1U, task_runner_->GetPendingTasks().size());
- // On startup, first update should happen immediately.
- EXPECT_EQ(base::TimeDelta(), task_runner_->NextPendingTaskDelay());
+ // On startup, first update should happen in 1 minute.
+ EXPECT_EQ(base::TimeDelta::FromMinutes(1),
+ task_runner_->NextPendingTaskDelay());
EXPECT_CALL(*mock_collector, GetDeviceStatus(_)).WillRepeatedly(Return(true));
EXPECT_CALL(*mock_collector, GetDeviceSessionStatus(_)).WillRepeatedly(
« no previous file with comments | « chrome/browser/chromeos/policy/status_uploader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698