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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « components/offline_pages/offline_page_feature.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/offline_pages/offline_page_model_impl.h" 5 #include "components/offline_pages/offline_page_model_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 base::FeatureList::ClearInstanceForTesting(); 1106 base::FeatureList::ClearInstanceForTesting();
1107 std::unique_ptr<base::FeatureList> feature_list2(new base::FeatureList); 1107 std::unique_ptr<base::FeatureList> feature_list2(new base::FeatureList);
1108 feature_list2->InitializeFromCommandLine( 1108 feature_list2->InitializeFromCommandLine(
1109 std::string(offline_pages::kOfflineBookmarksFeature.name) + "," + 1109 std::string(offline_pages::kOfflineBookmarksFeature.name) + "," +
1110 offline_pages::kOfflinePagesBackgroundLoadingFeature.name, 1110 offline_pages::kOfflinePagesBackgroundLoadingFeature.name,
1111 ""); 1111 "");
1112 base::FeatureList::SetInstance(std::move(feature_list2)); 1112 base::FeatureList::SetInstance(std::move(feature_list2));
1113 EXPECT_TRUE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled()); 1113 EXPECT_TRUE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled());
1114 } 1114 }
1115 1115
1116 TEST(CommandLineFlagsTest, OfflinePagesSharing) {
1117 // Enable offline bookmarks feature first.
1118 // TODO(dimich): once offline pages are enabled by default, remove this.
1119 base::FeatureList::ClearInstanceForTesting();
1120 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
1121 feature_list->InitializeFromCommandLine(
1122 offline_pages::kOfflineBookmarksFeature.name, "");
1123 base::FeatureList::SetInstance(std::move(feature_list));
1124
1125 // This feature is still disabled by default.
1126 EXPECT_FALSE(offline_pages::IsOfflinePagesSharingEnabled());
1127
1128 // Check if feature is correctly enabled by command-line flag.
1129 base::FeatureList::ClearInstanceForTesting();
1130 std::unique_ptr<base::FeatureList> feature_list2(new base::FeatureList);
1131 feature_list2->InitializeFromCommandLine(
1132 std::string(offline_pages::kOfflineBookmarksFeature.name) + "," +
1133 offline_pages::kOfflinePagesSharingFeature.name,
1134 "");
1135 base::FeatureList::SetInstance(std::move(feature_list2));
1136 EXPECT_TRUE(offline_pages::IsOfflinePagesSharingEnabled());
1137 }
1138
1116 } // namespace offline_pages 1139 } // namespace offline_pages
OLDNEW
« 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