| Index: components/offline_pages/core/offline_page_model_impl_unittest.cc
|
| diff --git a/components/offline_pages/core/offline_page_model_impl_unittest.cc b/components/offline_pages/core/offline_page_model_impl_unittest.cc
|
| index 678cc7066e01e15627018ac6f0264948a00855f9..0ecf8283ffc15f3604ea43df04c3fc8861e98b32 100644
|
| --- a/components/offline_pages/core/offline_page_model_impl_unittest.cc
|
| +++ b/components/offline_pages/core/offline_page_model_impl_unittest.cc
|
| @@ -1285,6 +1285,37 @@ TEST(CommandLineFlagsTest, OffliningRecentPages) {
|
| EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled());
|
| }
|
|
|
| +TEST(CommandLineFlagsTest, OffliningUsesNavigationTriggers) {
|
| + // All disabled by default.
|
| + EXPECT_FALSE(offline_pages::IsOffliningRecentPagesEnabled());
|
| + EXPECT_FALSE(offline_pages::IsOffliningRecentPagesUsingNavigationTriggers());
|
| + EXPECT_FALSE(offline_pages::IsOffliningRecentPagesUsingInteractionTriggers());
|
| +
|
| + // Enable Offline Page Cache.
|
| + std::unique_ptr<base::test::ScopedFeatureList> scoped_feature_list(
|
| + new base::test::ScopedFeatureList);
|
| + scoped_feature_list->InitFromCommandLine(
|
| + std::string(kOfflineBookmarksFeature.name) + "," +
|
| + kOffliningRecentPagesFeature.name,
|
| + "");
|
| +
|
| + // By default navigation triggers should be used.
|
| + EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled());
|
| + EXPECT_TRUE(offline_pages::IsOffliningRecentPagesUsingNavigationTriggers());
|
| + EXPECT_FALSE(offline_pages::IsOffliningRecentPagesUsingInteractionTriggers());
|
| +
|
| + // Check that when also disabling navigation triggers (and so enabling user
|
| + // interaction triggers), features are correctly reported.
|
| + scoped_feature_list.reset(new base::test::ScopedFeatureList);
|
| + scoped_feature_list->InitFromCommandLine(
|
| + std::string(kOfflineBookmarksFeature.name) + "," +
|
| + kOffliningRecentPagesFeature.name,
|
| + std::string(kOffliningUsesNavigationTriggersFeature.name));
|
| + EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled());
|
| + EXPECT_FALSE(offline_pages::IsOffliningRecentPagesUsingNavigationTriggers());
|
| + EXPECT_TRUE(offline_pages::IsOffliningRecentPagesUsingInteractionTriggers());
|
| +}
|
| +
|
| TEST(CommandLineFlagsTest, OfflinePagesSharing) {
|
| // Enable offline bookmarks feature first.
|
| // TODO(dimich): once offline pages are enabled by default, remove this.
|
|
|