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

Unified Diff: chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc

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
Index: chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc
diff --git a/chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc b/chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc
index c342a01fcdac80af62f0f3f82dbfdbe3a26e86f6..26f3d386c894d43df3e5f9932cbf8ab62cff677c 100644
--- a/chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc
+++ b/chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/chromeos/hats/hats_finch_helper.h"
#include <map>
+#include <set>
+#include <string>
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
@@ -13,6 +15,7 @@
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
#include "components/variations/variations_associated_data.h"
+#include "components/variations/variations_params_manager.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,8 +23,7 @@ namespace chromeos {
namespace {
-const char kGroupTesting[] = "Testing";
-const std::string kTrialName(features::kHappinessTrackingSystem.name);
+const std::string kFeatureAndTrialName(features::kHappinessTrackingSystem.name);
} // namespace
@@ -29,18 +31,12 @@ class HatsFinchHelperTest : public testing::Test {
public:
using ParamMap = std::map<std::string, std::string>;
- HatsFinchHelperTest() : params_manager_(kTrialName, {{}}) {}
-
- void SetUp() override {
- scoped_feature_list_.InitAndEnableFeature(
- features::kHappinessTrackingSystem);
- }
+ HatsFinchHelperTest() {}
void SetFinchSeedParams(ParamMap params) {
- // Clear all the things.
- variations::testing::ClearAllVariationParams();
- variations::testing::ClearAllVariationIDs();
- variations::AssociateVariationParams(kTrialName, kGroupTesting, params);
+ params_manager_.SetVariationParamsWithFeatureAssociations(
+ kFeatureAndTrialName /* trial name */, params,
+ std::set<std::string>{kFeatureAndTrialName} /*features to switch on */);
}
ParamMap CreateParamMap(std::string prob,
@@ -66,7 +62,6 @@ class HatsFinchHelperTest : public testing::Test {
private:
variations::testing::VariationParamsManager params_manager_;
- base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(HatsFinchHelperTest);
};
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698