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

Unified Diff: components/browser_sync/browser/profile_sync_service_unittest.cc

Issue 2226063002: Add a ScopedFeatureList class for testing and start using it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue in previous patchset. Created 4 years, 4 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
« no previous file with comments | « components/autofill/core/browser/personal_data_manager_unittest.cc ('k') | components/flags_ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/browser/profile_sync_service_unittest.cc
diff --git a/components/browser_sync/browser/profile_sync_service_unittest.cc b/components/browser_sync/browser/profile_sync_service_unittest.cc
index e53e159d1dff644b9f21902a622d19588a4fe1a8..45b5497ac841e71c33043714d6df8563df94e7ee 100644
--- a/components/browser_sync/browser/profile_sync_service_unittest.cc
+++ b/components/browser_sync/browser/profile_sync_service_unittest.cc
@@ -17,6 +17,7 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/sequenced_worker_pool_owner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
@@ -726,9 +727,9 @@ TEST_F(ProfileSyncServiceTest, MemoryPressureRecording) {
// Verify that OnLocalSetPassphraseEncryption triggers catch up configure sync
// cycle, calls ClearServerData, shuts down and restarts sync.
TEST_F(ProfileSyncServiceTest, OnLocalSetPassphraseEncryption) {
- base::FeatureList::ClearInstanceForTesting();
- ASSERT_TRUE(base::FeatureList::InitializeInstance(
- switches::kSyncClearDataOnPassphraseEncryption.name, std::string()));
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ switches::kSyncClearDataOnPassphraseEncryption);
IssueTestTokens();
CreateService(ProfileSyncService::AUTO_START);
@@ -778,9 +779,9 @@ TEST_F(ProfileSyncServiceTest, OnLocalSetPassphraseEncryption) {
TEST_F(ProfileSyncServiceTest,
OnLocalSetPassphraseEncryption_RestartDuringCatchUp) {
syncer::ConfigureReason configure_reason = syncer::CONFIGURE_REASON_UNKNOWN;
- base::FeatureList::ClearInstanceForTesting();
- ASSERT_TRUE(base::FeatureList::InitializeInstance(
- switches::kSyncClearDataOnPassphraseEncryption.name, std::string()));
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ switches::kSyncClearDataOnPassphraseEncryption);
IssueTestTokens();
CreateService(ProfileSyncService::AUTO_START);
ExpectSyncBackendHostCreation(1);
@@ -834,9 +835,9 @@ TEST_F(ProfileSyncServiceTest,
OnLocalSetPassphraseEncryption_RestartDuringClearServerData) {
syncer::SyncManager::ClearServerDataCallback captured_callback;
syncer::ConfigureReason configure_reason = syncer::CONFIGURE_REASON_UNKNOWN;
- base::FeatureList::ClearInstanceForTesting();
- ASSERT_TRUE(base::FeatureList::InitializeInstance(
- switches::kSyncClearDataOnPassphraseEncryption.name, std::string()));
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ switches::kSyncClearDataOnPassphraseEncryption);
IssueTestTokens();
CreateService(ProfileSyncService::AUTO_START);
ExpectSyncBackendHostCreationCaptureClearServerData(&captured_callback);
« no previous file with comments | « components/autofill/core/browser/personal_data_manager_unittest.cc ('k') | components/flags_ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698