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

Unified Diff: components/autofill/core/browser/autofill_manager_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
Index: components/autofill/core/browser/autofill_manager_unittest.cc
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
index fffcb837423d691f01ad685263b5fe473ae5f3c0..93330624b9351a92e0eceb444f00329610ec3239 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -24,6 +24,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/histogram_tester.h"
+#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "build/build_config.h"
@@ -768,7 +769,6 @@ class AutofillManagerTest : public testing::Test {
autofill_manager_->SetExternalDelegate(external_delegate_.get());
// Clear all the things.
- base::FeatureList::ClearInstanceForTesting();
variations::testing::ClearAllVariationParams();
}
@@ -803,7 +803,7 @@ class AutofillManagerTest : public testing::Test {
feature_list->RegisterFieldTrialOverride(
kAutofillCreditCardSigninPromo.name,
base::FeatureList::OVERRIDE_ENABLE_FEATURE, trial.get());
- base::FeatureList::SetInstance(std::move(feature_list));
+ scoped_feature_list_.InitWithFeatureList(std::move(feature_list));
// Double-checking our params made it.
std::map<std::string, std::string> actualParams;
@@ -1000,6 +1000,7 @@ class AutofillManagerTest : public testing::Test {
TestAutofillDownloadManager* download_manager_;
TestPersonalDataManager personal_data_;
base::FieldTrialList field_trial_list_;
+ base::test::ScopedFeatureList scoped_feature_list_;
};
class TestFormStructure : public FormStructure {

Powered by Google App Engine
This is Rietveld 408576698