| Index: chrome/browser/about_flags_unittest.cc
|
| diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc
|
| index ce459c77facae53e30104165c8f7eb81acf01a0a..2d86b973a8468118e0055ac7793d9334b4bc023e 100644
|
| --- a/chrome/browser/about_flags_unittest.cc
|
| +++ b/chrome/browser/about_flags_unittest.cc
|
| @@ -189,23 +189,23 @@ std::string FilePathStringTypeToString(const base::FilePath::StringType& path) {
|
| std::set<std::string> GetAllSwitchesForTesting() {
|
| std::set<std::string> result;
|
|
|
| - size_t num_experiments = 0;
|
| - const Experiment* experiments =
|
| - testing::GetExperiments(&num_experiments);
|
| -
|
| - for (size_t i = 0; i < num_experiments; ++i) {
|
| - const Experiment& experiment = experiments[i];
|
| - if (experiment.type == Experiment::SINGLE_VALUE ||
|
| - experiment.type == Experiment::SINGLE_DISABLE_VALUE) {
|
| - result.insert(experiment.command_line_switch);
|
| - } else if (experiment.type == Experiment::MULTI_VALUE) {
|
| - for (int j = 0; j < experiment.num_choices; ++j) {
|
| - result.insert(experiment.choices[j].command_line_switch);
|
| + size_t num_entries = 0;
|
| + const FeatureEntry* entries =
|
| + testing::GetFeatureEntries(&num_entries);
|
| +
|
| + for (size_t i = 0; i < num_entries; ++i) {
|
| + const FeatureEntry& entry = entries[i];
|
| + if (entry.type == FeatureEntry::SINGLE_VALUE ||
|
| + entry.type == FeatureEntry::SINGLE_DISABLE_VALUE) {
|
| + result.insert(entry.command_line_switch);
|
| + } else if (entry.type == FeatureEntry::MULTI_VALUE) {
|
| + for (int j = 0; j < entry.num_choices; ++j) {
|
| + result.insert(entry.choices[j].command_line_switch);
|
| }
|
| } else {
|
| - DCHECK_EQ(experiment.type, Experiment::ENABLE_DISABLE_VALUE);
|
| - result.insert(experiment.command_line_switch);
|
| - result.insert(experiment.disable_command_line_switch);
|
| + DCHECK_EQ(entry.type, FeatureEntry::ENABLE_DISABLE_VALUE);
|
| + result.insert(entry.command_line_switch);
|
| + result.insert(entry.disable_command_line_switch);
|
| }
|
| }
|
| return result;
|
| @@ -213,21 +213,21 @@ std::set<std::string> GetAllSwitchesForTesting() {
|
|
|
| } // anonymous namespace
|
|
|
| -const Experiment::Choice kMultiChoices[] = {
|
| +const FeatureEntry::Choice kMultiChoices[] = {
|
| { IDS_PRODUCT_NAME, "", "" },
|
| { IDS_PRODUCT_NAME, kMultiSwitch1, "" },
|
| { IDS_PRODUCT_NAME, kMultiSwitch2, kValueForMultiSwitch2 },
|
| };
|
|
|
| -// The experiments that are set for these tests. The 3rd experiment is not
|
| -// supported on the current platform, all others are.
|
| -static Experiment kExperiments[] = {
|
| +// The entries that are set for these tests. The 3rd entry is not supported on
|
| +// the current platform, all others are.
|
| +static FeatureEntry kEntries[] = {
|
| {
|
| kFlags1,
|
| IDS_PRODUCT_NAME,
|
| IDS_PRODUCT_NAME,
|
| 0, // Ends up being mapped to the current platform.
|
| - Experiment::SINGLE_VALUE,
|
| + FeatureEntry::SINGLE_VALUE,
|
| kSwitch1,
|
| "",
|
| NULL,
|
| @@ -240,7 +240,7 @@ static Experiment kExperiments[] = {
|
| IDS_PRODUCT_NAME,
|
| IDS_PRODUCT_NAME,
|
| 0, // Ends up being mapped to the current platform.
|
| - Experiment::SINGLE_VALUE,
|
| + FeatureEntry::SINGLE_VALUE,
|
| kSwitch2,
|
| kValueForSwitch2,
|
| NULL,
|
| @@ -253,7 +253,7 @@ static Experiment kExperiments[] = {
|
| IDS_PRODUCT_NAME,
|
| IDS_PRODUCT_NAME,
|
| 0, // This ends up enabling for an OS other than the current.
|
| - Experiment::SINGLE_VALUE,
|
| + FeatureEntry::SINGLE_VALUE,
|
| kSwitch3,
|
| "",
|
| NULL,
|
| @@ -266,7 +266,7 @@ static Experiment kExperiments[] = {
|
| IDS_PRODUCT_NAME,
|
| IDS_PRODUCT_NAME,
|
| 0, // Ends up being mapped to the current platform.
|
| - Experiment::MULTI_VALUE,
|
| + FeatureEntry::MULTI_VALUE,
|
| "",
|
| "",
|
| "",
|
| @@ -279,7 +279,7 @@ static Experiment kExperiments[] = {
|
| IDS_PRODUCT_NAME,
|
| IDS_PRODUCT_NAME,
|
| 0, // Ends up being mapped to the current platform.
|
| - Experiment::ENABLE_DISABLE_VALUE,
|
| + FeatureEntry::ENABLE_DISABLE_VALUE,
|
| kSwitch1,
|
| kEnableDisableValue1,
|
| kSwitch2,
|
| @@ -292,7 +292,7 @@ static Experiment kExperiments[] = {
|
| IDS_PRODUCT_NAME,
|
| IDS_PRODUCT_NAME,
|
| 0,
|
| - Experiment::SINGLE_DISABLE_VALUE,
|
| + FeatureEntry::SINGLE_DISABLE_VALUE,
|
| kSwitch6,
|
| "",
|
| NULL,
|
| @@ -311,18 +311,18 @@ class AboutFlagsTest : public ::testing::Test {
|
| }
|
|
|
| void SetUp() override {
|
| - for (size_t i = 0; i < arraysize(kExperiments); ++i)
|
| - kExperiments[i].supported_platforms = GetCurrentPlatform();
|
| + for (size_t i = 0; i < arraysize(kEntries); ++i)
|
| + kEntries[i].supported_platforms = GetCurrentPlatform();
|
|
|
| int os_other_than_current = 1;
|
| while (os_other_than_current == GetCurrentPlatform())
|
| os_other_than_current <<= 1;
|
| - kExperiments[2].supported_platforms = os_other_than_current;
|
| + kEntries[2].supported_platforms = os_other_than_current;
|
|
|
| - testing::SetExperiments(kExperiments, arraysize(kExperiments));
|
| + testing::SetFeatureEntries(kEntries, arraysize(kEntries));
|
| }
|
|
|
| - void TearDown() override { testing::SetExperiments(NULL, 0); }
|
| + void TearDown() override { testing::SetFeatureEntries(NULL, 0); }
|
|
|
| TestingPrefServiceSimple prefs_;
|
| flags_ui::PrefServiceFlagsStorage flags_storage_;
|
| @@ -331,87 +331,87 @@ class AboutFlagsTest : public ::testing::Test {
|
|
|
| TEST_F(AboutFlagsTest, NoChangeNoRestart) {
|
| EXPECT_FALSE(IsRestartNeededToCommitChanges());
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, false);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, false);
|
| EXPECT_FALSE(IsRestartNeededToCommitChanges());
|
|
|
| // kFlags6 is enabled by default, so enabling should not require a restart.
|
| - SetExperimentEnabled(&flags_storage_, kFlags6, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags6, true);
|
| EXPECT_FALSE(IsRestartNeededToCommitChanges());
|
| }
|
|
|
| TEST_F(AboutFlagsTest, ChangeNeedsRestart) {
|
| EXPECT_FALSE(IsRestartNeededToCommitChanges());
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
| EXPECT_TRUE(IsRestartNeededToCommitChanges());
|
| }
|
|
|
| -// Tests that disabling a default enabled experiment requires a restart.
|
| +// Tests that disabling a default enabled entry requires a restart.
|
| TEST_F(AboutFlagsTest, DisableChangeNeedsRestart) {
|
| EXPECT_FALSE(IsRestartNeededToCommitChanges());
|
| - SetExperimentEnabled(&flags_storage_, kFlags6, false);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags6, false);
|
| EXPECT_TRUE(IsRestartNeededToCommitChanges());
|
| }
|
|
|
| TEST_F(AboutFlagsTest, MultiFlagChangeNeedsRestart) {
|
| - const Experiment& experiment = kExperiments[3];
|
| - ASSERT_EQ(kFlags4, experiment.internal_name);
|
| + const FeatureEntry& entry = kEntries[3];
|
| + ASSERT_EQ(kFlags4, entry.internal_name);
|
| EXPECT_FALSE(IsRestartNeededToCommitChanges());
|
| // Enable the 2nd choice of the multi-value.
|
| - SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(2), true);
|
| + SetFeatureEntryEnabled(&flags_storage_, entry.NameForChoice(2), true);
|
| EXPECT_TRUE(IsRestartNeededToCommitChanges());
|
| testing::ClearState();
|
| EXPECT_FALSE(IsRestartNeededToCommitChanges());
|
| // Enable the default choice now.
|
| - SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(0), true);
|
| + SetFeatureEntryEnabled(&flags_storage_, entry.NameForChoice(0), true);
|
| EXPECT_TRUE(IsRestartNeededToCommitChanges());
|
| }
|
|
|
| TEST_F(AboutFlagsTest, AddTwoFlagsRemoveOne) {
|
| - // Add two experiments, check they're there.
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| - SetExperimentEnabled(&flags_storage_, kFlags2, true);
|
| + // Add two entriess, check they're there.
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags2, true);
|
|
|
| - const base::ListValue* experiments_list =
|
| + const base::ListValue* entries_list =
|
| prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| - ASSERT_TRUE(experiments_list != NULL);
|
| + ASSERT_TRUE(entries_list != NULL);
|
|
|
| - ASSERT_EQ(2u, experiments_list->GetSize());
|
| + ASSERT_EQ(2u, entries_list->GetSize());
|
|
|
| std::string s0;
|
| - ASSERT_TRUE(experiments_list->GetString(0, &s0));
|
| + ASSERT_TRUE(entries_list->GetString(0, &s0));
|
| std::string s1;
|
| - ASSERT_TRUE(experiments_list->GetString(1, &s1));
|
| + ASSERT_TRUE(entries_list->GetString(1, &s1));
|
|
|
| EXPECT_TRUE(s0 == kFlags1 || s1 == kFlags1);
|
| EXPECT_TRUE(s0 == kFlags2 || s1 == kFlags2);
|
|
|
| - // Remove one experiment, check the other's still around.
|
| - SetExperimentEnabled(&flags_storage_, kFlags2, false);
|
| + // Remove one entry, check the other's still around.
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags2, false);
|
|
|
| - experiments_list = prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| - ASSERT_TRUE(experiments_list != NULL);
|
| - ASSERT_EQ(1u, experiments_list->GetSize());
|
| - ASSERT_TRUE(experiments_list->GetString(0, &s0));
|
| + entries_list = prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| + ASSERT_TRUE(entries_list != NULL);
|
| + ASSERT_EQ(1u, entries_list->GetSize());
|
| + ASSERT_TRUE(entries_list->GetString(0, &s0));
|
| EXPECT_TRUE(s0 == kFlags1);
|
| }
|
|
|
| TEST_F(AboutFlagsTest, AddTwoFlagsRemoveBoth) {
|
| - // Add two experiments, check the pref exists.
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| - SetExperimentEnabled(&flags_storage_, kFlags2, true);
|
| - const base::ListValue* experiments_list =
|
| + // Add two entries, check the pref exists.
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags2, true);
|
| + const base::ListValue* entries_list =
|
| prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| - ASSERT_TRUE(experiments_list != NULL);
|
| + ASSERT_TRUE(entries_list != NULL);
|
|
|
| // Remove both, the pref should have been removed completely.
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, false);
|
| - SetExperimentEnabled(&flags_storage_, kFlags2, false);
|
| - experiments_list = prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| - EXPECT_TRUE(experiments_list == NULL || experiments_list->GetSize() == 0);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, false);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags2, false);
|
| + entries_list = prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| + EXPECT_TRUE(entries_list == NULL || entries_list->GetSize() == 0);
|
| }
|
|
|
| TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) {
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
|
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| command_line.AppendSwitch("foo");
|
| @@ -444,7 +444,7 @@ base::CommandLine::StringType CreateSwitch(const std::string& value) {
|
| }
|
|
|
| TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) {
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
|
|
| const std::string kDoubleDash("--");
|
|
|
| @@ -476,8 +476,8 @@ TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) {
|
| }
|
|
|
| // Now both have flags but different.
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, false);
|
| - SetExperimentEnabled(&flags_storage_, kFlags2, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, false);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags2, true);
|
|
|
| base::CommandLine another_command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &another_command_line, kAddSentinels);
|
| @@ -503,7 +503,7 @@ TEST_F(AboutFlagsTest, RemoveFlagSwitches) {
|
| switch_list[switches::kFlagSwitchesEnd] = base::CommandLine::StringType();
|
| switch_list["foo"] = base::CommandLine::StringType();
|
|
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
|
|
| // This shouldn't do anything before ConvertFlagsToSwitches() wasn't called.
|
| RemoveFlagsSwitches(&switch_list);
|
| @@ -526,40 +526,40 @@ TEST_F(AboutFlagsTest, RemoveFlagSwitches) {
|
| EXPECT_TRUE(switch_list.find("foo") != switch_list.end());
|
| }
|
|
|
| -// Tests enabling experiments that aren't supported on the current platform.
|
| +// Tests enabling entries that aren't supported on the current platform.
|
| TEST_F(AboutFlagsTest, PersistAndPrune) {
|
| - // Enable experiments 1 and 3.
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| - SetExperimentEnabled(&flags_storage_, kFlags3, true);
|
| + // Enable entries 1 and 3.
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags3, true);
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| EXPECT_FALSE(command_line.HasSwitch(kSwitch1));
|
| EXPECT_FALSE(command_line.HasSwitch(kSwitch3));
|
|
|
| - // Convert the flags to switches. Experiment 3 shouldn't be among the switches
|
| + // Convert the flags to switches. Entry 3 shouldn't be among the switches
|
| // as it is not applicable to the current platform.
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| EXPECT_TRUE(command_line.HasSwitch(kSwitch1));
|
| EXPECT_FALSE(command_line.HasSwitch(kSwitch3));
|
|
|
| - // Experiment 3 should show still be persisted in preferences though.
|
| - const base::ListValue* experiments_list =
|
| + // FeatureEntry 3 should show still be persisted in preferences though.
|
| + const base::ListValue* entries_list =
|
| prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| - ASSERT_TRUE(experiments_list);
|
| - EXPECT_EQ(2U, experiments_list->GetSize());
|
| + ASSERT_TRUE(entries_list);
|
| + EXPECT_EQ(2U, entries_list->GetSize());
|
| std::string s0;
|
| - ASSERT_TRUE(experiments_list->GetString(0, &s0));
|
| + ASSERT_TRUE(entries_list->GetString(0, &s0));
|
| EXPECT_EQ(kFlags1, s0);
|
| std::string s1;
|
| - ASSERT_TRUE(experiments_list->GetString(1, &s1));
|
| + ASSERT_TRUE(entries_list->GetString(1, &s1));
|
| EXPECT_EQ(kFlags3, s1);
|
| }
|
|
|
| // Tests that switches which should have values get them in the command
|
| // line.
|
| TEST_F(AboutFlagsTest, CheckValues) {
|
| - // Enable experiments 1 and 2.
|
| - SetExperimentEnabled(&flags_storage_, kFlags1, true);
|
| - SetExperimentEnabled(&flags_storage_, kFlags2, true);
|
| + // Enable entries 1 and 2.
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags1, true);
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags2, true);
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| EXPECT_FALSE(command_line.HasSwitch(kSwitch1));
|
| EXPECT_FALSE(command_line.HasSwitch(kSwitch2));
|
| @@ -599,24 +599,24 @@ TEST_F(AboutFlagsTest, CheckValues) {
|
| #endif
|
|
|
| // And it should persist.
|
| - const base::ListValue* experiments_list =
|
| + const base::ListValue* entries_list =
|
| prefs_.GetList(flags_ui::prefs::kEnabledLabsExperiments);
|
| - ASSERT_TRUE(experiments_list);
|
| - EXPECT_EQ(2U, experiments_list->GetSize());
|
| + ASSERT_TRUE(entries_list);
|
| + EXPECT_EQ(2U, entries_list->GetSize());
|
| std::string s0;
|
| - ASSERT_TRUE(experiments_list->GetString(0, &s0));
|
| + ASSERT_TRUE(entries_list->GetString(0, &s0));
|
| EXPECT_EQ(kFlags1, s0);
|
| std::string s1;
|
| - ASSERT_TRUE(experiments_list->GetString(1, &s1));
|
| + ASSERT_TRUE(entries_list->GetString(1, &s1));
|
| EXPECT_EQ(kFlags2, s1);
|
| }
|
|
|
| -// Tests multi-value type experiments.
|
| +// Tests multi-value type entries.
|
| TEST_F(AboutFlagsTest, MultiValues) {
|
| - const Experiment& experiment = kExperiments[3];
|
| - ASSERT_EQ(kFlags4, experiment.internal_name);
|
| + const FeatureEntry& entry = kEntries[3];
|
| + ASSERT_EQ(kFlags4, entry.internal_name);
|
|
|
| - // Initially, the first "deactivated" option of the multi experiment should
|
| + // Initially, the first "deactivated" option of the multi entry should
|
| // be set.
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| @@ -626,7 +626,7 @@ TEST_F(AboutFlagsTest, MultiValues) {
|
| }
|
|
|
| // Enable the 2nd choice of the multi-value.
|
| - SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(2), true);
|
| + SetFeatureEntryEnabled(&flags_storage_, entry.NameForChoice(2), true);
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| @@ -636,8 +636,8 @@ TEST_F(AboutFlagsTest, MultiValues) {
|
| command_line.GetSwitchValueASCII(kMultiSwitch2));
|
| }
|
|
|
| - // Disable the multi-value experiment.
|
| - SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(0), true);
|
| + // Disable the multi-value entry.
|
| + SetFeatureEntryEnabled(&flags_storage_, entry.NameForChoice(0), true);
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| @@ -646,7 +646,7 @@ TEST_F(AboutFlagsTest, MultiValues) {
|
| }
|
| }
|
|
|
| -// Tests that disable flags are added when an experiment is disabled.
|
| +// Tests that disable flags are added when an entry is disabled.
|
| TEST_F(AboutFlagsTest, DisableFlagCommandLine) {
|
| // Nothing selected.
|
| {
|
| @@ -655,16 +655,16 @@ TEST_F(AboutFlagsTest, DisableFlagCommandLine) {
|
| EXPECT_FALSE(command_line.HasSwitch(kSwitch6));
|
| }
|
|
|
| - // Disable the experiment 6.
|
| - SetExperimentEnabled(&flags_storage_, kFlags6, false);
|
| + // Disable the entry 6.
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags6, false);
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| EXPECT_TRUE(command_line.HasSwitch(kSwitch6));
|
| }
|
|
|
| - // Enable experiment 6.
|
| - SetExperimentEnabled(&flags_storage_, kFlags6, true);
|
| + // Enable entry 6.
|
| + SetFeatureEntryEnabled(&flags_storage_, kFlags6, true);
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| @@ -673,8 +673,8 @@ TEST_F(AboutFlagsTest, DisableFlagCommandLine) {
|
| }
|
|
|
| TEST_F(AboutFlagsTest, EnableDisableValues) {
|
| - const Experiment& experiment = kExperiments[4];
|
| - ASSERT_EQ(kFlags5, experiment.internal_name);
|
| + const FeatureEntry& entry = kEntries[4];
|
| + ASSERT_EQ(kFlags5, entry.internal_name);
|
|
|
| // Nothing selected.
|
| {
|
| @@ -685,7 +685,7 @@ TEST_F(AboutFlagsTest, EnableDisableValues) {
|
| }
|
|
|
| // "Enable" option selected.
|
| - SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(1), true);
|
| + SetFeatureEntryEnabled(&flags_storage_, entry.NameForChoice(1), true);
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| @@ -695,7 +695,7 @@ TEST_F(AboutFlagsTest, EnableDisableValues) {
|
| }
|
|
|
| // "Disable" option selected.
|
| - SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(2), true);
|
| + SetFeatureEntryEnabled(&flags_storage_, entry.NameForChoice(2), true);
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| @@ -705,7 +705,7 @@ TEST_F(AboutFlagsTest, EnableDisableValues) {
|
| }
|
|
|
| // "Default" option selected, same as nothing selected.
|
| - SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(0), true);
|
| + SetFeatureEntryEnabled(&flags_storage_, entry.NameForChoice(0), true);
|
| {
|
| base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
|
| ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels);
|
| @@ -714,13 +714,13 @@ TEST_F(AboutFlagsTest, EnableDisableValues) {
|
| }
|
| }
|
|
|
| -// Makes sure there are no separators in any of the experiment names.
|
| +// Makes sure there are no separators in any of the entry names.
|
| TEST_F(AboutFlagsTest, NoSeparators) {
|
| - testing::SetExperiments(NULL, 0);
|
| + testing::SetFeatureEntries(NULL, 0);
|
| size_t count;
|
| - const Experiment* experiments = testing::GetExperiments(&count);
|
| - for (size_t i = 0; i < count; ++i) {
|
| - std::string name = experiments->internal_name;
|
| + const FeatureEntry* entries = testing::GetFeatureEntries(&count);
|
| + for (size_t i = 0; i < count; ++i) {
|
| + std::string name = entries[i].internal_name;
|
| EXPECT_EQ(std::string::npos, name.find(testing::kMultiSeparator)) << i;
|
| }
|
| }
|
|
|