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

Unified Diff: components/offline_pages/offline_page_model_unittest.cc

Issue 1772233003: Flag for Background Loading of Offline Pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put @VisibleForTesting in the right place. 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 | « components/offline_pages/offline_page_feature.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/offline_page_model_unittest.cc
diff --git a/components/offline_pages/offline_page_model_unittest.cc b/components/offline_pages/offline_page_model_unittest.cc
index ab3a31525d91dabfac5beeda02d8bdb5eea5d2c6..3c4e2162fb9c9a05f7b4125e7c0cc63d03c5d4ad 100644
--- a/components/offline_pages/offline_page_model_unittest.cc
+++ b/components/offline_pages/offline_page_model_unittest.cc
@@ -1011,4 +1011,20 @@ TEST(CommandLineFlagsTest, OffliningRecentPages) {
EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled());
}
+TEST(CommandLineFlagsTest, OfflinePagesBackgroundLoading) {
+ // TODO(dimich): once offline pages are enabled by default, remove this.
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableOfflinePages);
+ // Disabled by default.
+ EXPECT_FALSE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled());
+
+ // Check if feature is correctly enabled by command-line flag.
+ base::FeatureList::ClearInstanceForTesting();
+ scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ feature_list->InitializeFromCommandLine(
+ offline_pages::kOfflinePagesBackgroundLoadingFeature.name, "");
+ base::FeatureList::SetInstance(std::move(feature_list));
+ EXPECT_TRUE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled());
+}
+
} // namespace offline_pages
« no previous file with comments | « components/offline_pages/offline_page_feature.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698