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

Unified Diff: components/offline_pages/offline_page_model_impl_unittest.cc

Issue 2068393002: Flag for Offline Page Sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve merge conflict Created 4 years, 5 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_impl_unittest.cc
diff --git a/components/offline_pages/offline_page_model_impl_unittest.cc b/components/offline_pages/offline_page_model_impl_unittest.cc
index 0be40257c37df5ef0d05898a05cfdc775a3f7704..57b5735d75425af8514dace494106d1a4274ddf4 100644
--- a/components/offline_pages/offline_page_model_impl_unittest.cc
+++ b/components/offline_pages/offline_page_model_impl_unittest.cc
@@ -1113,4 +1113,27 @@ TEST(CommandLineFlagsTest, OfflinePagesBackgroundLoading) {
EXPECT_TRUE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled());
}
+TEST(CommandLineFlagsTest, OfflinePagesSharing) {
+ // Enable offline bookmarks feature first.
+ // TODO(dimich): once offline pages are enabled by default, remove this.
+ base::FeatureList::ClearInstanceForTesting();
+ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ feature_list->InitializeFromCommandLine(
+ offline_pages::kOfflineBookmarksFeature.name, "");
+ base::FeatureList::SetInstance(std::move(feature_list));
+
+ // This feature is still disabled by default.
+ EXPECT_FALSE(offline_pages::IsOfflinePagesSharingEnabled());
+
+ // Check if feature is correctly enabled by command-line flag.
+ base::FeatureList::ClearInstanceForTesting();
+ std::unique_ptr<base::FeatureList> feature_list2(new base::FeatureList);
+ feature_list2->InitializeFromCommandLine(
+ std::string(offline_pages::kOfflineBookmarksFeature.name) + "," +
+ offline_pages::kOfflinePagesSharingFeature.name,
+ "");
+ base::FeatureList::SetInstance(std::move(feature_list2));
+ EXPECT_TRUE(offline_pages::IsOfflinePagesSharingEnabled());
+}
+
} // 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