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

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: change flag name 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
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 31b37237355138b503f4756cd47228d79a86edfd..a85e6de2aec343c3d4fd5192a6f8c6ac2e3ce7d7 100644
--- a/components/offline_pages/offline_page_model_unittest.cc
+++ b/components/offline_pages/offline_page_model_unittest.cc
@@ -1009,4 +1009,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

Powered by Google App Engine
This is Rietveld 408576698