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

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client_unittest.cc

Issue 1668523002: [Password Manager] Switch password manager code to use the Feature framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/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 d1f0ff6fee8a11d864fae8dcde3dbc1e699b9d12..d94838510f851c75085d0e382df7d55bd5b03c14 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -9,7 +9,6 @@
#include <string>
#include <tuple>
-#include "base/command_line.h"
#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string16.h"
@@ -27,10 +26,10 @@
#include "components/password_manager/core/browser/log_receiver.h"
#include "components/password_manager/core/browser/log_router.h"
#include "components/password_manager/core/browser/password_manager_internals_service.h"
+#include "components/password_manager/core/browser/password_manager_test_utils.h"
#include "components/password_manager/core/common/credential_manager_types.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
-#include "components/password_manager/core/common/password_manager_switches.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/testing_pref_service.h"
@@ -169,11 +168,13 @@ TEST_F(ChromePasswordManagerClientTest,
TEST_F(ChromePasswordManagerClientTest,
IsAutomaticPasswordSavingEnabledWhenFlagIsSetTest) {
// Add the enable-automatic-password-saving feature.
- base::FeatureList::ClearInstanceForTesting();
scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
- feature_list->InitializeFromCommandLine(
- password_manager::features::kEnableAutomaticPasswordSaving.name, "");
- base::FeatureList::SetInstance(std::move(feature_list));
+ 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));
if (chrome::GetChannel() == version_info::Channel::UNKNOWN)
EXPECT_TRUE(GetClient()->IsAutomaticPasswordSavingEnabled());

Powered by Google App Engine
This is Rietveld 408576698