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

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: Created 4 years, 6 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_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 184858c9bb7941ad440b7ce31b0edcc36bdbdb5d..d0e189b6b389ff181d1f5ae4604421979eca18eb 100644
--- a/components/offline_pages/offline_page_model_impl_unittest.cc
+++ b/components/offline_pages/offline_page_model_impl_unittest.cc
@@ -1077,4 +1077,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,
+ "");
fgorski 2016/06/15 22:54:28 nit: I think git cl format might disagree with thi
Vivian 2016/06/16 00:47:27 Seems that git cl format didn't change the format
+ base::FeatureList::SetInstance(std::move(feature_list2));
+ EXPECT_TRUE(offline_pages::IsOfflinePagesSharingEnabled());
+}
+
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698