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

Side by Side Diff: components/offline_pages/offline_page_model_unittest.cc

Issue 1772233003: Flag for Background Loading of Offline Pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put @VisibleForTesting in the right place. Created 4 years, 9 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.h" 5 #include "components/offline_pages/offline_page_model.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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 1004
1005 // Check if feature is correctly enabled by command-line flag. 1005 // Check if feature is correctly enabled by command-line flag.
1006 base::FeatureList::ClearInstanceForTesting(); 1006 base::FeatureList::ClearInstanceForTesting();
1007 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); 1007 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
1008 feature_list->InitializeFromCommandLine( 1008 feature_list->InitializeFromCommandLine(
1009 offline_pages::kOffliningRecentPagesFeature.name, ""); 1009 offline_pages::kOffliningRecentPagesFeature.name, "");
1010 base::FeatureList::SetInstance(std::move(feature_list)); 1010 base::FeatureList::SetInstance(std::move(feature_list));
1011 EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled()); 1011 EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled());
1012 } 1012 }
1013 1013
1014 TEST(CommandLineFlagsTest, OfflinePagesBackgroundLoading) {
1015 // TODO(dimich): once offline pages are enabled by default, remove this.
1016 base::CommandLine::ForCurrentProcess()->AppendSwitch(
1017 switches::kEnableOfflinePages);
1018 // Disabled by default.
1019 EXPECT_FALSE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled());
1020
1021 // Check if feature is correctly enabled by command-line flag.
1022 base::FeatureList::ClearInstanceForTesting();
1023 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
1024 feature_list->InitializeFromCommandLine(
1025 offline_pages::kOfflinePagesBackgroundLoadingFeature.name, "");
1026 base::FeatureList::SetInstance(std::move(feature_list));
1027 EXPECT_TRUE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled());
1028 }
1029
1014 } // namespace offline_pages 1030 } // 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