Create separate sections for available/unavailable flags.
On Linux, searching for "this experiment is not supported" returns 23
results. To make it a little easier to navigate, create a separate
section to list all the unsupported experiments.
BUG=179649
Review URL: https://chromiumcodereview.appspot.com/12748002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201015 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc
index 036c707..5ae5c8c 100644
--- a/chrome/browser/about_flags_unittest.cc
+++ b/chrome/browser/about_flags_unittest.cc
@@ -267,10 +267,16 @@
EXPECT_FALSE(command_line.HasSwitch(kSwitch3));
// Experiment 3 should show still be persisted in preferences though.
- scoped_ptr<ListValue> switch_prefs(
- GetFlagsExperimentsData(&prefs_, kOwnerAccessToFlags));
- ASSERT_TRUE(switch_prefs.get());
- EXPECT_EQ(arraysize(kExperiments), switch_prefs->GetSize());
+ const ListValue* experiments_list =
+ prefs_.GetList(prefs::kEnabledLabsExperiments);
+ ASSERT_TRUE(experiments_list);
+ EXPECT_EQ(2U, experiments_list->GetSize());
+ std::string s0;
+ ASSERT_TRUE(experiments_list->GetString(0, &s0));
+ EXPECT_EQ(kFlags1, s0);
+ std::string s1;
+ ASSERT_TRUE(experiments_list->GetString(1, &s1));
+ EXPECT_EQ(kFlags3, s1);
}
// Tests that switches which should have values get them in the command
@@ -317,11 +323,17 @@
command_line.GetCommandLineString().find(switch2_with_equals));
#endif
- // And it should persist
- scoped_ptr<ListValue> switch_prefs(
- GetFlagsExperimentsData(&prefs_, kOwnerAccessToFlags));
- ASSERT_TRUE(switch_prefs.get());
- EXPECT_EQ(arraysize(kExperiments), switch_prefs->GetSize());
+ // And it should persist.
+ const ListValue* experiments_list =
+ prefs_.GetList(prefs::kEnabledLabsExperiments);
+ ASSERT_TRUE(experiments_list);
+ EXPECT_EQ(2U, experiments_list->GetSize());
+ std::string s0;
+ ASSERT_TRUE(experiments_list->GetString(0, &s0));
+ EXPECT_EQ(kFlags1, s0);
+ std::string s1;
+ ASSERT_TRUE(experiments_list->GetString(1, &s1));
+ EXPECT_EQ(kFlags2, s1);
}
// Tests multi-value type experiments.