OLD | NEW |
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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 | 1002 |
1003 // Check if feature is correctly enabled by command-line flag. | 1003 // Check if feature is correctly enabled by command-line flag. |
1004 base::FeatureList::ClearInstanceForTesting(); | 1004 base::FeatureList::ClearInstanceForTesting(); |
1005 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); | 1005 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); |
1006 feature_list->InitializeFromCommandLine( | 1006 feature_list->InitializeFromCommandLine( |
1007 offline_pages::kOffliningRecentPagesFeature.name, ""); | 1007 offline_pages::kOffliningRecentPagesFeature.name, ""); |
1008 base::FeatureList::SetInstance(std::move(feature_list)); | 1008 base::FeatureList::SetInstance(std::move(feature_list)); |
1009 EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled()); | 1009 EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled()); |
1010 } | 1010 } |
1011 | 1011 |
| 1012 TEST(CommandLineFlagsTest, OfflinePagesBackgroundLoading) { |
| 1013 // TODO(dimich): once offline pages are enabled by default, remove this. |
| 1014 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1015 switches::kEnableOfflinePages); |
| 1016 // Disabled by default. |
| 1017 EXPECT_FALSE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled()); |
| 1018 |
| 1019 // Check if feature is correctly enabled by command-line flag. |
| 1020 base::FeatureList::ClearInstanceForTesting(); |
| 1021 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 1022 feature_list->InitializeFromCommandLine( |
| 1023 offline_pages::kOfflinePagesBackgroundLoadingFeature.name, ""); |
| 1024 base::FeatureList::SetInstance(std::move(feature_list)); |
| 1025 EXPECT_TRUE(offline_pages::IsOfflinePagesBackgroundLoadingEnabled()); |
| 1026 } |
| 1027 |
1012 } // namespace offline_pages | 1028 } // namespace offline_pages |
OLD | NEW |