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

Side by Side Diff: components/variations/variations_http_header_provider_unittest.cc

Issue 1528543003: Implement plumbing for variations in feedback reports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-add function that was lost in a rebase. Created 5 years 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 unified diff | Download patch
« no previous file with comments | « components/variations/variations_http_header_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/variations/variations_http_header_provider.h" 5 #include "components/variations/variations_http_header_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 std::string variations = provider.GetClientDataHeader(); 117 std::string variations = provider.GetClientDataHeader();
118 118
119 std::set<VariationID> variation_ids; 119 std::set<VariationID> variation_ids;
120 std::set<VariationID> trigger_ids; 120 std::set<VariationID> trigger_ids;
121 ASSERT_TRUE(ExtractVariationIds(variations, &variation_ids, &trigger_ids)); 121 ASSERT_TRUE(ExtractVariationIds(variations, &variation_ids, &trigger_ids));
122 EXPECT_TRUE(variation_ids.find(123) != variation_ids.end()); 122 EXPECT_TRUE(variation_ids.find(123) != variation_ids.end());
123 EXPECT_TRUE(trigger_ids.find(456) != trigger_ids.end()); 123 EXPECT_TRUE(trigger_ids.find(456) != trigger_ids.end());
124 } 124 }
125 125
126 TEST_F(VariationsHttpHeaderProviderTest, GetVariationsString) {
127 base::MessageLoop loop;
128 base::FieldTrialList field_trial_list(nullptr);
129
130 CreateTrialAndAssociateId("t1", "g1", GOOGLE_WEB_PROPERTIES, 123);
131 CreateTrialAndAssociateId("t2", "g2", GOOGLE_WEB_PROPERTIES, 124);
132
133 VariationsHttpHeaderProvider provider;
134 provider.SetDefaultVariationIds("100,200");
135 EXPECT_EQ(" 100 123 124 200 ", provider.GetVariationsString());
136 }
137
126 } // namespace variations 138 } // namespace variations
OLDNEW
« no previous file with comments | « components/variations/variations_http_header_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698