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

Unified Diff: chrome/browser/services/gcm/gcm_account_tracker_unittest.cc

Issue 631343002: [GCM] Fetching OAuth2 tokens periodically in account tracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mapper-in-driver
Patch Set: Created 6 years, 2 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: chrome/browser/services/gcm/gcm_account_tracker_unittest.cc
diff --git a/chrome/browser/services/gcm/gcm_account_tracker_unittest.cc b/chrome/browser/services/gcm/gcm_account_tracker_unittest.cc
index d3911f022e6e58319955ad87312a288c0f92c085..a1e0f67e7affa0a09f126513a6e4fd8b4ce91b02 100644
--- a/chrome/browser/services/gcm/gcm_account_tracker_unittest.cc
+++ b/chrome/browser/services/gcm/gcm_account_tracker_unittest.cc
@@ -8,8 +8,7 @@
#include <string>
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
-#include "base/run_loop.h"
+#include "chrome/test/base/testing_pref_service_syncable.h"
#include "components/gcm_driver/fake_gcm_driver.h"
#include "google_apis/gaia/fake_identity_provider.h"
#include "google_apis/gaia/fake_oauth2_token_service.h"
@@ -170,6 +169,7 @@ class GCMAccountTrackerTest : public testing::Test {
scoped_ptr<FakeOAuth2TokenService> fake_token_service_;
scoped_ptr<FakeIdentityProvider> fake_identity_provider_;
scoped_ptr<GCMAccountTracker> tracker_;
+ scoped_ptr<TestingPrefServiceSyncable> pref_service_;
};
GCMAccountTrackerTest::GCMAccountTrackerTest() {
@@ -183,7 +183,14 @@ GCMAccountTrackerTest::GCMAccountTrackerTest() {
new net::TestURLRequestContextGetter(
message_loop_.message_loop_proxy())));
- tracker_.reset(new GCMAccountTracker(gaia_account_tracker.Pass(), &driver_));
+ pref_service_.reset(new TestingPrefServiceSyncable);
+ pref_service_->registry()->RegisterInt64Pref(
+ "gcm.last_token_fetching_ts",
+ 0L,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+
+ tracker_.reset(new GCMAccountTracker(
+ gaia_account_tracker.Pass(), &driver_, pref_service_.get()));
}
GCMAccountTrackerTest::~GCMAccountTrackerTest() {

Powered by Google App Engine
This is Rietveld 408576698