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

Unified Diff: components/autofill/core/browser/autofill_assistant_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_assistant_unittest.cc
diff --git a/components/autofill/core/browser/autofill_assistant_unittest.cc b/components/autofill/core/browser/autofill_assistant_unittest.cc
index b1a61d8c600e33ee261c2fa470e0649cbdb88f26..4f93f192dfbf5bf3ceb3e2df02bc18b3c30f9a80 100644
--- a/components/autofill/core/browser/autofill_assistant_unittest.cc
+++ b/components/autofill/core/browser/autofill_assistant_unittest.cc
@@ -10,6 +10,7 @@
#include "base/feature_list.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/autofill_driver.h"
#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/autofill_manager.h"
@@ -58,11 +59,7 @@ class AutofillAssistantTest : public testing::Test {
autofill_assistant_(&autofill_manager_) {}
void EnableAutofillCreditCardAssist() {
- base::FeatureList::ClearInstanceForTesting();
- std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
- feature_list->InitializeFromCommandLine(kAutofillCreditCardAssist.name,
- std::string());
- base::FeatureList::SetInstance(std::move(feature_list));
+ scoped_feature_list_.InitAndEnableFeature(kAutofillCreditCardAssist);
}
// Returns an initialized FormStructure with credit card form data. To be
@@ -105,6 +102,7 @@ class AutofillAssistantTest : public testing::Test {
testing::NiceMock<TestAutofillDriver> autofill_driver_;
MockAutofillManager autofill_manager_;
AutofillAssistant autofill_assistant_;
+ base::test::ScopedFeatureList scoped_feature_list_;
};
MATCHER_P(CreditCardMatches, guid, "") {

Powered by Google App Engine
This is Rietveld 408576698