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

Unified Diff: chrome/browser/policy/cloud/cloud_policy_browsertest.cc

Issue 226093005: Reduce unneeded policy fetches by detecting expired invalidations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/cloud_policy_invalidator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/cloud/cloud_policy_browsertest.cc
diff --git a/chrome/browser/policy/cloud/cloud_policy_browsertest.cc b/chrome/browser/policy/cloud/cloud_policy_browsertest.cc
index 479c64b868d89af0669d8a3a8f35b92001b6060c..b3446d31dd2aee924f448ff52d9408df69f61d50 100644
--- a/chrome/browser/policy/cloud/cloud_policy_browsertest.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_browsertest.cc
@@ -12,6 +12,7 @@
#include "base/prefs/pref_service.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
+#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/invalidation/fake_invalidation_service.h"
@@ -312,10 +313,12 @@ IN_PROC_BROWSER_TEST_F(CloudPolicyTest, InvalidatePolicy) {
// Update the homepage in the policy and trigger an invalidation.
ASSERT_NO_FATAL_FAILURE(SetServerPolicy(GetTestPolicy("youtube.com", 0)));
+ base::TimeDelta now =
+ base::Time::NowFromSystemTime() - base::Time::UnixEpoch();
GetInvalidationService()->EmitInvalidationForTest(
syncer::Invalidation::Init(
invalidation::ObjectId(16, "test_policy"),
- 1 /* version */,
+ now.InMicroseconds() /* version */,
"payload"));
{
base::RunLoop run_loop;
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/cloud_policy_invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698