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

Unified Diff: chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc

Issue 1899433002: Update flags used by offline pages and bookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 years, 8 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: chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc b/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc
index 06444514709e5822ea572a554a534e0fca0336af..efce964a1d243444fa4964b2cddb0c84b07d4005 100644
--- a/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc
+++ b/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc
@@ -7,16 +7,16 @@
#include <memory>
#include "base/bind.h"
-#include "base/command_line.h"
+#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
#include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "components/offline_pages/offline_page_feature.h"
#include "components/offline_pages/offline_page_item.h"
#include "components/offline_pages/offline_page_model.h"
-#include "components/offline_pages/offline_page_switches.h"
#include "components/offline_pages/offline_page_test_archiver.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
@@ -95,17 +95,20 @@ class OfflinePageTabHelperTest :
};
void OfflinePageTabHelperTest::SetUp() {
+ // Enables offline pages feature.
+ // TODO(jianli): Remove this once the feature is completely enabled.
+ base::FeatureList::ClearInstanceForTesting();
+ scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ feature_list->InitializeFromCommandLine(
+ offline_pages::kOfflineBookmarksFeature.name, "");
+ base::FeatureList::SetInstance(std::move(feature_list));
+
// Creates a test web contents.
content::RenderViewHostTestHarness::SetUp();
OfflinePageTabHelper::CreateForWebContents(web_contents());
offline_page_tab_helper_ =
OfflinePageTabHelper::FromWebContents(web_contents());
- // Enables offline pages feature.
- // TODO(jianli): Remove this once the feature is completely enabled.
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableOfflinePages);
-
// Sets up the factory for testing.
OfflinePageModelFactory::GetInstance()->SetTestingFactoryAndUse(
browser_context(), BuildTestOfflinePageModel);

Powered by Google App Engine
This is Rietveld 408576698