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

Unified Diff: base/feature_list_unittest.cc

Issue 1812883003: Enable features API for content shell and webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comment in BrowserMainLoop Created 4 years, 9 months 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 | « base/feature_list.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/feature_list_unittest.cc
diff --git a/base/feature_list_unittest.cc b/base/feature_list_unittest.cc
index 038913d44ead854d461d14601e1fe532753f9223..58a7ebcab5982c147cb7b65b1e2c2fa80c47ba87 100644
--- a/base/feature_list_unittest.cc
+++ b/base/feature_list_unittest.cc
@@ -424,4 +424,23 @@ TEST_F(FeatureListTest, InitializeFromCommandLine_UseDefault) {
EXPECT_TRUE(FieldTrialList::IsTrialActive("T2"));
}
+TEST_F(FeatureListTest, InitializeInstance) {
+ ClearFeatureListInstance();
+
+ scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ FeatureList::SetInstance(std::move(feature_list));
+ EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOnByDefault));
+ EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
+
+ // Initialize from command line if we haven't yet.
+ FeatureList::InitializeInstance("", kFeatureOnByDefaultName);
+ EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOnByDefault));
+ EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
+
+ // Do not initialize from commandline if we have already.
+ FeatureList::InitializeInstance(kFeatureOffByDefaultName, "");
+ EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOnByDefault));
+ EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
+}
+
} // namespace base
« no previous file with comments | « base/feature_list.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698