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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/core/offline_page_feature.cc
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc
index ef2b4700ca49aa982799f4ad83b8f395822f47c7..9f283129f19998394c55e78a14e01f77ed38b763 100644
--- a/components/offline_pages/core/offline_page_feature.cc
+++ b/components/offline_pages/core/offline_page_feature.cc
@@ -6,8 +6,19 @@
#include <string>
+#include "base/command_line.h"
#include "base/feature_list.h"
+namespace switches {
+
+// This flag significantly shortens the delay between WebContentsObserver events
+// and SnapshotController's StartSnapshot calls. The purpose is to speed up
+// integration tests.
+const char kOfflinePagesUseTestingSnapshotDelay[] =
+ "short-offline-page-snapshot-delay-for-test";
+
+} // namespace switches
+
namespace offline_pages {
const base::Feature kOfflineBookmarksFeature{"OfflineBookmarks",
@@ -68,4 +79,9 @@ bool ShouldUseNewBackgroundLoader() {
return base::FeatureList::IsEnabled(kNewBackgroundLoaderFeature);
}
+bool ShouldUseTestingSnapshotDelay() {
+ base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
+ return cl->HasSwitch(switches::kOfflinePagesUseTestingSnapshotDelay);
+}
+
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698