| Index: base/feature_list_unittest.cc
|
| diff --git a/base/feature_list_unittest.cc b/base/feature_list_unittest.cc
|
| index a7e7b71183b32e7e263e4f9c7c47c382d215f56c..583a01c7d146e31376c875ca21d26269e15f3497 100644
|
| --- a/base/feature_list_unittest.cc
|
| +++ b/base/feature_list_unittest.cc
|
| @@ -457,4 +457,28 @@ TEST_F(FeatureListTest, InitializeInstance) {
|
| EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
|
| }
|
|
|
| +TEST_F(FeatureListTest, UninitializedInstance_IsEnabledReturnsFalse) {
|
| + ClearFeatureListInstance();
|
| + // This test case simulates the calling pattern found in code which does not
|
| + // explicitly initialize the features list.
|
| + // All IsEnabled() calls should return the default value in this scenario.
|
| + EXPECT_EQ(nullptr, FeatureList::GetInstance());
|
| + EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOnByDefault));
|
| + EXPECT_EQ(nullptr, FeatureList::GetInstance());
|
| + EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
|
| +}
|
| +
|
| +TEST_F(FeatureListTest, UninitializedInstance_GetFieldTrialReturnsNullptr) {
|
| + ClearFeatureListInstance();
|
| + // This test case simulates the calling pattern found in code which does not
|
| + // explicitly initialize the features list.
|
| + // All GetFieldTrial() calls should return nullptr in this case.
|
| + // IsTrialActive() should also return false.
|
| + EXPECT_EQ(nullptr, FeatureList::GetInstance());
|
| + EXPECT_EQ(nullptr, FeatureList::GetFieldTrial(kFeatureOffByDefault));
|
| + EXPECT_EQ(nullptr, FeatureList::GetInstance());
|
| + EXPECT_EQ(nullptr, FeatureList::GetFieldTrial(kFeatureOnByDefault));
|
| + EXPECT_FALSE(FieldTrialList::IsTrialActive("Trial"));
|
| +}
|
| +
|
| } // namespace base
|
|
|