Chromium Code Reviews| 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 |