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

Unified Diff: chrome/browser/metrics/variations/variations_seed_store_unittest.cc

Issue 238443008: Make VariationsService simulate received seeds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
Index: chrome/browser/metrics/variations/variations_seed_store_unittest.cc
===================================================================
--- chrome/browser/metrics/variations/variations_seed_store_unittest.cc (revision 265923)
+++ chrome/browser/metrics/variations/variations_seed_store_unittest.cc (working copy)
@@ -24,6 +24,10 @@
: VariationsSeedStore(local_state) {}
virtual ~TestVariationsSeedStore() {}
+ bool StoreSeedForTesting(const std::string& seed_data) {
+ return StoreSeedData(seed_data, std::string(), base::Time::Now(), NULL);
+ }
+
virtual VariationsSeedStore::VerifySignatureResult VerifySeedSignature(
const std::string& seed_bytes,
const std::string& base64_seed_signature) OVERRIDE {
@@ -122,7 +126,6 @@
}
TEST(VariationsSeedStoreTest, StoreSeedData) {
- const base::Time now = base::Time::Now();
const VariationsSeed seed = CreateTestSeed();
const std::string serialized_seed = SerializeSeed(seed);
@@ -131,7 +134,7 @@
TestVariationsSeedStore seed_store(&prefs);
- EXPECT_TRUE(seed_store.StoreSeedData(serialized_seed, std::string(), now));
+ EXPECT_TRUE(seed_store.StoreSeedForTesting(serialized_seed));
// Make sure the pref was actually set.
EXPECT_FALSE(PrefHasDefaultValue(prefs, prefs::kVariationsSeed));
@@ -144,7 +147,7 @@
// Check if trying to store a bad seed leaves the pref unchanged.
prefs.ClearPref(prefs::kVariationsSeed);
- EXPECT_FALSE(seed_store.StoreSeedData("should fail", std::string(), now));
+ EXPECT_FALSE(seed_store.StoreSeedForTesting("should fail"));
EXPECT_TRUE(PrefHasDefaultValue(prefs, prefs::kVariationsSeed));
}

Powered by Google App Engine
This is Rietveld 408576698