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

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

Issue 2830033003: Use {To/From}JavaTime for policy timestamps (Closed)
Patch Set: Rebase Created 3 years, 8 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 828a0d78758a2e2ab080ab413e09d843ffcba954..2861083313d4636734a0c0f24edbd9b11238c572 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
@@ -51,11 +51,8 @@ class CloudPolicyRefreshSchedulerTest : public testing::Test {
base::Time now = base::Time::NowFromSystemTime();
base::TimeDelta initial_age =
base::TimeDelta::FromMinutes(kInitialCacheAgeMinutes);
- store_.policy_->set_timestamp(
- ((now - initial_age) - base::Time::UnixEpoch()).InMilliseconds());
- last_update_ =
- base::Time::UnixEpoch() +
- base::TimeDelta::FromMilliseconds(store_.policy_->timestamp());
+ store_.policy_->set_timestamp((now - initial_age).ToJavaTime());
+ last_update_ = base::Time::FromJavaTime(store_.policy_->timestamp());
last_update_ticks_ = base::TimeTicks::Now() +
(last_update_ - base::Time::NowFromSystemTime());
}

Powered by Google App Engine
This is Rietveld 408576698