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

Unified Diff: components/variations/variations_associated_data.h

Issue 2321273003: Extend VariationParamsManager to support feature associations. (Closed)
Patch Set: Last comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/variations/BUILD.gn ('k') | components/variations/variations_associated_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/variations_associated_data.h
diff --git a/components/variations/variations_associated_data.h b/components/variations/variations_associated_data.h
index 046c2b6f5459a3e7ec635e1650e11603a63fb6f4..0734e8be495a5058b6b009f70a3c4c7f8ea0e524 100644
--- a/components/variations/variations_associated_data.h
+++ b/components/variations/variations_associated_data.h
@@ -10,7 +10,6 @@
#include <string>
#include <vector>
-#include "base/metrics/field_trial.h"
#include "components/variations/active_field_trials.h"
// This file provides various helpers that extend the functionality around
@@ -45,7 +44,7 @@
namespace base {
struct Feature;
-}
+} // namespace base
namespace variations {
@@ -163,35 +162,14 @@ std::string GetVariationParamValueByFeature(const base::Feature& feature,
// Expose some functions for testing.
namespace testing {
-// Use this class as a member in your test class to set variation params for
-// your tests. You can directly set the parameters in the constructor (if they
-// are used by other members upon construction). You can change them later
-// arbitrarily many times using the SetVariationParams function. Internally, it
-// creates a FieldTrialList as a member. It works well for multiple tests of a
-// given test class, as it clears the parameters when this class is destructed.
-// Note that it clears all parameters (not just those registered here).
-class VariationParamsManager {
- public:
- VariationParamsManager(const std::string& trial_name,
- const std::map<std::string, std::string>& params);
- ~VariationParamsManager();
-
- // Associates |params| with the given |trial_name|. It creates a new group,
- // used only for testing. Between two calls of this function,
- // ClearAllVariationParams() has to be called.
- void SetVariationParams(const std::string& trial_name,
- const std::map<std::string, std::string>& params);
-
- private:
- std::unique_ptr<base::FieldTrialList> field_trial_list_;
-
- DISALLOW_COPY_AND_ASSIGN(VariationParamsManager);
-};
-
-// Clears all of the mapped associations.
+// Clears all of the mapped associations. Deprecated, try to use
+// VariationParamsManager instead as it does a lot of work for you
+// automatically.
void ClearAllVariationIDs();
-// Clears all of the associated params.
+// Clears all of the associated params. Deprecated, try to use
+// VariationParamsManager instead as it does a lot of work for you
+// automatically.
void ClearAllVariationParams();
} // namespace testing
« no previous file with comments | « components/variations/BUILD.gn ('k') | components/variations/variations_associated_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698