Chromium Code Reviews| 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..0f951f8e747695a45d64bf05ce0412f4b48cc7cd 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,18 @@ 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, |
|
Sorin Jianu
2016/12/05 17:39:34
Maybe use // style comments instead of /**/ for co
jkrcal
2016/12/05 21:47:15
Done.
(I hope I've understood you correctly)
|
| + std::set<std::string>{kFeatureAndTrialName} /*associated_features*/); |
| } |
| void ExpectAttributesWithTag(const SwReporterInstallerTraits& traits, |