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

Unified Diff: components/password_manager/core/browser/password_manager_unittest.cc

Issue 2080263002: Change fill-on-account-select to use Features API, not a custom flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused GRD strings Created 4 years, 6 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/password_manager/core/browser/password_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc
index 44f5e9d2d19a116ad23feac8d84cd58078f1f7ba..677643d25621cc5722ed026e4f458e4d52b4369a 100644
--- a/components/password_manager/core/browser/password_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -8,6 +8,7 @@
#include <utility>
#include <vector>
+#include "base/feature_list.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
@@ -124,6 +125,18 @@ ACTION_P(SaveToScopedPtr, scoped) { scoped->reset(arg0); }
class PasswordManagerTest : public testing::Test {
protected:
void SetUp() override {
+ // TODO(jww): The following FeatureList clear can be removed once
+ // https://crbug.com/620435 is resolved. This cleanup is needed because on
+ // some platforms (e.g. iOS), the base::FeatureList is not reset betwen
+ // test runs, so if these unit tests are run right after some other unit
+ // tests that turn on a feature, that might affect these tests. In
+ // particular, the earlier fill-on-account-select unit tests turned on
+ // their respective Feature and that was incorrectly left on for these
+ // tests.
+ base::FeatureList::ClearInstanceForTesting();
+ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ base::FeatureList::SetInstance(std::move(feature_list));
+
store_ = new testing::StrictMock<MockPasswordStore>;
EXPECT_CALL(*store_, ReportMetrics(_, _)).Times(AnyNumber());
CHECK(store_->Init(syncer::SyncableService::StartSyncFlare()));

Powered by Google App Engine
This is Rietveld 408576698