#include "components/password_manager/content/browser/content_password_manager_driver.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/content/common/mojom/autofill_agent.mojom.h"
#include "components/autofill/core/browser/logging/stub_log_manager.h"
#include "components/autofill/core/common/unique_ids.h"
#include "components/password_manager/content/browser/form_meta_data.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_form_cache.h"
#include "components/password_manager/core/browser/password_form_filling.h"
#include "components/password_manager/core/browser/password_manager_driver.h"
#include "components/password_manager/core/browser/stub_password_manager_client.h"
#include "components/safe_browsing/buildflags.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
#include "content/test/test_render_frame_host.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/features.h"
ParsingResult;
PasswordFormFillData;
ASCIIToUTF16;
_;
ElementsAre;
NiceMock;
Return;
namespace password_manager {
namespace {
class MockLogManager : public autofill::StubLogManager { … };
class MockPasswordManagerClient : public StubPasswordManagerClient { … };
class FakePasswordAutofillAgent
: public autofill::mojom::PasswordAutofillAgent { … };
class MockPasswordManager : public PasswordManager { … };
class MockPasswordFormCache : public PasswordFormCache { … };
PasswordFormFillData GetTestPasswordFormFillData() { … }
MATCHER(WerePasswordsCleared, "Passwords not cleared") { … }
MATCHER_P(FormDataEqualTo, form_data, "") { … }
}
class ContentPasswordManagerDriverTest
: public content::RenderViewHostTestHarness,
public testing::WithParamInterface<bool> { … };
TEST_P(ContentPasswordManagerDriverTest, SendLoggingStateInCtor) { … }
TEST_P(ContentPasswordManagerDriverTest, SendLoggingStateAfterLogManagerReady) { … }
TEST_F(ContentPasswordManagerDriverTest, ClearPasswordsOnAutofill) { … }
TEST_F(ContentPasswordManagerDriverTest, SetFrameAndFormMetaDataOfForm) { … }
TEST_P(ContentPasswordManagerDriverTest, LogFilledFieldTypeMetric) { … }
INSTANTIATE_TEST_SUITE_P(…);
class ContentPasswordManagerDriverURLTest
: public ContentPasswordManagerDriverTest { … };
TEST_F(ContentPasswordManagerDriverURLTest, PasswordFormsParsed) { … }
TEST_F(ContentPasswordManagerDriverURLTest, PasswordFormsRendered) { … }
TEST_F(ContentPasswordManagerDriverURLTest, PasswordFormSubmitted) { … }
TEST_F(ContentPasswordManagerDriverURLTest, PasswordFormCleared) { … }
class ContentPasswordManagerDriverFencedFramesTest
: public ContentPasswordManagerDriverTest { … };
TEST_F(ContentPasswordManagerDriverFencedFramesTest,
SetFrameAndFormMetaDataOfForm) { … }
TEST_F(ContentPasswordManagerDriverTest,
PasswordAutofillDisabledOnCredentiallessIframe) { … }
}