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

Side by Side Diff: components/offline_pages/core/offline_page_feature.cc

Issue 2655273003: Adds a first integration test for the Recent Tabs feature. (Closed)
Patch Set: Fix wrapping of comment text. Created 3 years, 10 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
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/core/offline_page_feature.h" 5 #include "components/offline_pages/core/offline_page_feature.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h"
9 #include "base/feature_list.h" 10 #include "base/feature_list.h"
10 11
12 namespace switches {
13
14 // This flag significantly shortens the delay between WebContentsObserver events
15 // and SnapshotController's StartSnapshot calls. The purpose is to speed up
16 // integration tests.
17 const char kOfflinePagesUseTestingSnapshotDelay[] =
18 "short-offline-page-snapshot-delay-for-test";
19
20 } // namespace switches
21
11 namespace offline_pages { 22 namespace offline_pages {
12 23
13 const base::Feature kOfflineBookmarksFeature{"OfflineBookmarks", 24 const base::Feature kOfflineBookmarksFeature{"OfflineBookmarks",
14 base::FEATURE_DISABLED_BY_DEFAULT}; 25 base::FEATURE_DISABLED_BY_DEFAULT};
15 26
16 const base::Feature kOffliningRecentPagesFeature{ 27 const base::Feature kOffliningRecentPagesFeature{
17 "OfflineRecentPages", base::FEATURE_DISABLED_BY_DEFAULT}; 28 "OfflineRecentPages", base::FEATURE_DISABLED_BY_DEFAULT};
18 29
19 const base::Feature kOfflinePagesCTFeature{"OfflinePagesCT", 30 const base::Feature kOfflinePagesCTFeature{"OfflinePagesCT",
20 base::FEATURE_ENABLED_BY_DEFAULT}; 31 base::FEATURE_ENABLED_BY_DEFAULT};
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 72 }
62 73
63 bool IsOfflinePagesAsyncDownloadEnabled() { 74 bool IsOfflinePagesAsyncDownloadEnabled() {
64 return base::FeatureList::IsEnabled(kOfflinePagesAsyncDownloadFeature); 75 return base::FeatureList::IsEnabled(kOfflinePagesAsyncDownloadFeature);
65 } 76 }
66 77
67 bool ShouldUseNewBackgroundLoader() { 78 bool ShouldUseNewBackgroundLoader() {
68 return base::FeatureList::IsEnabled(kNewBackgroundLoaderFeature); 79 return base::FeatureList::IsEnabled(kNewBackgroundLoaderFeature);
69 } 80 }
70 81
82 bool ShouldUseTestingSnapshotDelay() {
83 base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
84 return cl->HasSwitch(switches::kOfflinePagesUseTestingSnapshotDelay);
85 }
86
71 } // namespace offline_pages 87 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698