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

Unified Diff: chrome/browser/component_updater/sw_reporter_installer_win_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
« no previous file with comments | « chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc b/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc
index d8fbb38fa8d5762c3b2cebc0f90798df39489729..fdbbf146ae3049afe3c241fa3e7717a179179cf6 100644
--- a/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc
+++ b/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc
@@ -23,7 +23,7 @@
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/safe_browsing/srt_fetcher_win.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"
@@ -137,25 +137,19 @@ class ExperimentalSwReporterInstallerTest : public SwReporterInstallerTest {
void CreateFeatureWithParams(
const std::map<std::string, std::string>& params) {
- constexpr char kFeatureName[] = "ExperimentalSwReporterEngine";
+ constexpr char kFeatureAndTrialName[] = "ExperimentalSwReporterEngine";
std::map<std::string, std::string> params_with_group = params;
params_with_group["experiment_group_for_reporting"] = kExperimentGroupName;
// Assign the given variation params to the experiment group until
// |variations_| goes out of scope when the test exits. This will also
- // create a FieldTrial for this group.
+ // create a FieldTrial for this group and associate the params with the
+ // feature.
variations_ = std::make_unique<variations::testing::VariationParamsManager>(
- kFeatureName, params_with_group);
-
- // Create a feature list containing only the field trial for this group,
- // and enable it for the length of the test.
- base::FieldTrial* trial = base::FieldTrialList::Find(kFeatureName);
- ASSERT_TRUE(trial);
- auto feature_list = std::make_unique<base::FeatureList>();
- feature_list->RegisterFieldTrialOverride(
- kFeatureName, base::FeatureList::OVERRIDE_ENABLE_FEATURE, trial);
- scoped_feature_list_.InitWithFeatureList(std::move(feature_list));
+ kFeatureAndTrialName, // trial_name
+ params_with_group,
+ std::set<std::string>{kFeatureAndTrialName}); // associated_features
}
void ExpectAttributesWithTag(const SwReporterInstallerTraits& traits,
« no previous file with comments | « chrome/browser/chromeos/hats/hats_finch_helper_unittest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698