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

Unified Diff: components/variations/variations_http_header_provider_unittest.cc

Issue 2182553002: Add other variations (with ids) for NTPSnippets to chrome://flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alexei's comment #5 + fix a bug Created 4 years, 5 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 | « components/variations/variations_http_header_provider.cc ('k') | ios/chrome/browser/about_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/variations_http_header_provider_unittest.cc
diff --git a/components/variations/variations_http_header_provider_unittest.cc b/components/variations/variations_http_header_provider_unittest.cc
index 90552c844765bc00a86e024df8b61a7213f242ac..a1b9d3da8fc1e10e46b8fc6cc5eafc1a83ad4226 100644
--- a/components/variations/variations_http_header_provider_unittest.cc
+++ b/components/variations/variations_http_header_provider_unittest.cc
@@ -65,7 +65,7 @@ TEST_F(VariationsHttpHeaderProviderTest, SetDefaultVariationIds_Valid) {
VariationsHttpHeaderProvider provider;
// Valid experiment ids.
- EXPECT_TRUE(provider.SetDefaultVariationIds("12,456,t789"));
+ EXPECT_TRUE(provider.SetDefaultVariationIds({"12", "456", "t789"}));
provider.InitVariationIDsCacheIfNeeded();
std::string variations = provider.GetClientDataHeader();
EXPECT_FALSE(variations.empty());
@@ -83,12 +83,14 @@ TEST_F(VariationsHttpHeaderProviderTest, SetDefaultVariationIds_Invalid) {
VariationsHttpHeaderProvider provider;
// Invalid experiment ids.
- EXPECT_FALSE(provider.SetDefaultVariationIds("abcd12,456"));
+ EXPECT_FALSE(provider.SetDefaultVariationIds(
+ std::vector<std::string>{"abcd12", "456"}));
provider.InitVariationIDsCacheIfNeeded();
EXPECT_TRUE(provider.GetClientDataHeader().empty());
// Invalid trigger experiment id
- EXPECT_FALSE(provider.SetDefaultVariationIds("12,tabc456"));
+ EXPECT_FALSE(provider.SetDefaultVariationIds(
+ std::vector<std::string>{"12", "tabc456"}));
provider.InitVariationIDsCacheIfNeeded();
EXPECT_TRUE(provider.GetClientDataHeader().empty());
}
@@ -131,7 +133,10 @@ TEST_F(VariationsHttpHeaderProviderTest, GetVariationsString) {
CreateTrialAndAssociateId("t2", "g2", GOOGLE_WEB_PROPERTIES, 124);
VariationsHttpHeaderProvider provider;
- provider.SetDefaultVariationIds("100,200");
+ std::vector<std::string> ids;
+ ids.push_back("100");
+ ids.push_back("200");
+ provider.SetDefaultVariationIds(ids);
EXPECT_EQ(" 100 123 124 200 ", provider.GetVariationsString());
}
« no previous file with comments | « components/variations/variations_http_header_provider.cc ('k') | ios/chrome/browser/about_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698