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

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client_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 | « base/test/scoped_feature_list.cc ('k') | components/autofill/core/browser/autofill_assistant_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
index 588dc8d0fc1c6b1841027e9b3fafeccc91d3fadf..b086529e529ac5328138c55ca097d30b8a695b62 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -13,6 +13,7 @@
#include "base/metrics/field_trial.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_feature_list.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
#include "chrome/common/channel_info.h"
@@ -167,13 +168,9 @@ TEST_F(ChromePasswordManagerClientTest,
TEST_F(ChromePasswordManagerClientTest,
IsAutomaticPasswordSavingEnabledWhenFlagIsSetTest) {
// Add the enable-automatic-password-saving feature.
- std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
- std::vector<const base::Feature*> enabled_features;
- std::vector<const base::Feature*> disabled_features;
- enabled_features.push_back(
- &password_manager::features::kEnableAutomaticPasswordSaving);
- password_manager::SetFeatures(enabled_features, disabled_features,
- std::move(feature_list));
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ password_manager::features::kEnableAutomaticPasswordSaving);
if (chrome::GetChannel() == version_info::Channel::UNKNOWN)
EXPECT_TRUE(GetClient()->IsAutomaticPasswordSavingEnabled());
« no previous file with comments | « base/test/scoped_feature_list.cc ('k') | components/autofill/core/browser/autofill_assistant_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698