OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_seed_processor.h" | 5 #include "components/variations/variations_seed_processor.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 DISALLOW_COPY_AND_ASSIGN(TestOverrideStringCallback); | 104 DISALLOW_COPY_AND_ASSIGN(TestOverrideStringCallback); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace | 107 } // namespace |
108 | 108 |
109 class VariationsSeedProcessorTest : public ::testing::Test { | 109 class VariationsSeedProcessorTest : public ::testing::Test { |
110 public: | 110 public: |
111 VariationsSeedProcessorTest() { | 111 VariationsSeedProcessorTest() { |
112 } | 112 } |
113 | 113 |
114 virtual ~VariationsSeedProcessorTest() { | 114 ~VariationsSeedProcessorTest() override { |
115 // Ensure that the maps are cleared between tests, since they are stored as | 115 // Ensure that the maps are cleared between tests, since they are stored as |
116 // process singletons. | 116 // process singletons. |
117 testing::ClearAllVariationIDs(); | 117 testing::ClearAllVariationIDs(); |
118 testing::ClearAllVariationParams(); | 118 testing::ClearAllVariationParams(); |
119 } | 119 } |
120 | 120 |
121 bool CreateTrialFromStudy(const Study* study) { | 121 bool CreateTrialFromStudy(const Study* study) { |
122 ProcessedStudy processed_study; | 122 ProcessedStudy processed_study; |
123 if (processed_study.Init(study, false)) { | 123 if (processed_study.Init(study, false)) { |
124 VariationsSeedProcessor().CreateTrialFromStudy( | 124 VariationsSeedProcessor().CreateTrialFromStudy( |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 base::FieldTrialList::FindFullName(study.name())); | 481 base::FieldTrialList::FindFullName(study.name())); |
482 | 482 |
483 // Check that params and experiment ids correspond. | 483 // Check that params and experiment ids correspond. |
484 EXPECT_EQ("y", GetVariationParamValue(study.name(), "x")); | 484 EXPECT_EQ("y", GetVariationParamValue(study.name(), "x")); |
485 VariationID id = GetGoogleVariationID(GOOGLE_WEB_PROPERTIES, kFlagStudyName, | 485 VariationID id = GetGoogleVariationID(GOOGLE_WEB_PROPERTIES, kFlagStudyName, |
486 kNonFlagGroupName); | 486 kNonFlagGroupName); |
487 EXPECT_EQ(kExperimentId, id); | 487 EXPECT_EQ(kExperimentId, id); |
488 } | 488 } |
489 | 489 |
490 } // namespace variations | 490 } // namespace variations |
OLD | NEW |