#include "chrome/browser/ui/passwords/manage_passwords_state.h"
#include <iterator>
#include <memory>
#include <utility>
#include <vector>
#include "base/containers/to_vector.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/mock_callback.h"
#include "components/password_manager/core/browser/mock_password_form_manager_for_ui.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/stub_password_manager_client.h"
#include "components/password_manager/core/common/password_manager_ui.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
ASCIIToUTF16;
MockPasswordFormManagerForUI;
PasswordForm;
PasswordStoreChange;
PasswordStoreChangeList;
_;
Contains;
ElementsAre;
IsEmpty;
Mock;
Not;
Pointee;
Return;
UnorderedElementsAre;
namespace {
constexpr char kTestOrigin[] = …;
constexpr char kTestPSLOrigin[] = …;
std::vector<raw_ptr<const PasswordForm, VectorExperimental>> GetRawPointers(
const std::vector<std::unique_ptr<PasswordForm>>& forms) { … }
class MockPasswordManagerClient
: public password_manager::StubPasswordManagerClient { … };
class ManagePasswordsStateTest : public testing::Test { … };
std::unique_ptr<MockPasswordFormManagerForUI>
ManagePasswordsStateTest::CreateFormManager(
std::vector<PasswordForm> best_matches,
std::vector<PasswordForm> federated_matches) { … }
void ManagePasswordsStateTest::TestNoisyUpdates() { … }
void ManagePasswordsStateTest::TestAllUpdates() { … }
void ManagePasswordsStateTest::TestBlocklistedUpdates() { … }
TEST_F(ManagePasswordsStateTest, DefaultState) { … }
TEST_F(ManagePasswordsStateTest, PasswordSubmitted) { … }
TEST_F(ManagePasswordsStateTest, PasswordSaved) { … }
TEST_F(ManagePasswordsStateTest, PasswordSubmittedFederationsPresent) { … }
TEST_F(ManagePasswordsStateTest, OnRequestCredentials) { … }
TEST_F(ManagePasswordsStateTest, AutoSignin) { … }
TEST_F(ManagePasswordsStateTest, AutomaticPasswordSave) { … }
TEST_F(ManagePasswordsStateTest, AutomaticPasswordSaveWithFederations) { … }
TEST_F(ManagePasswordsStateTest, PasswordAutofilled) { … }
TEST_F(ManagePasswordsStateTest, PasswordAutofillWithSavedFederations) { … }
TEST_F(ManagePasswordsStateTest, PasswordAutofillWithOnlyFederations) { … }
TEST_F(ManagePasswordsStateTest, ActiveOnMixedPSLAndNonPSLMatched) { … }
TEST_F(ManagePasswordsStateTest, InactiveOnPSLMatched) { … }
TEST_F(ManagePasswordsStateTest, OnInactive) { … }
TEST_F(ManagePasswordsStateTest, PendingPasswordAddBlocklisted) { … }
TEST_F(ManagePasswordsStateTest, DefaultStoreChanged) { … }
TEST_F(ManagePasswordsStateTest, RequestCredentialsAddBlocklisted) { … }
TEST_F(ManagePasswordsStateTest, AutoSigninAddBlocklisted) { … }
TEST_F(ManagePasswordsStateTest, AutomaticPasswordSaveAddBlocklisted) { … }
TEST_F(ManagePasswordsStateTest, BackgroundAutofilledAddBlocklisted) { … }
TEST_F(ManagePasswordsStateTest, PasswordUpdateAddBlocklisted) { … }
TEST_F(ManagePasswordsStateTest, PasswordUpdateSubmitted) { … }
TEST_F(ManagePasswordsStateTest, AndroidPasswordUpdateSubmitted) { … }
TEST_F(ManagePasswordsStateTest, PasswordUpdateSubmittedWithFederations) { … }
TEST_F(ManagePasswordsStateTest, ChooseCredentialLocal) { … }
TEST_F(ManagePasswordsStateTest, ChooseCredentialEmpty) { … }
TEST_F(ManagePasswordsStateTest, ChooseCredentialLocalWithNonEmptyFederation) { … }
TEST_F(ManagePasswordsStateTest, AutofillCausedByInternalFormManager) { … }
TEST_F(ManagePasswordsStateTest, ProcessUnsyncedCredentialsWillBeDeleted) { … }
TEST_F(ManagePasswordsStateTest, OnMovablePasswordSubmitted) { … }
TEST_F(ManagePasswordsStateTest, OnKeychainError) { … }
TEST_F(ManagePasswordsStateTest, OpenPasswordDetailsBubble) { … }
}