#include "components/autofill/content/browser/content_autofill_driver_factory.h"
#include <memory>
#include <string_view>
#include <utility>
#include "base/check_deref.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
#include "components/autofill/content/browser/content_autofill_driver_factory_test_api.h"
#include "components/autofill/content/browser/test_autofill_client_injector.h"
#include "components/autofill/content/browser/test_content_autofill_client.h"
#include "components/autofill/content/browser/test_content_autofill_driver.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/test_matchers.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.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"
namespace autofill {
namespace {
LazyRef;
SaveArgPtr;
_;
AllOf;
AtLeast;
Between;
DoAll;
InSequence;
Property;
Ref;
Truly;
auto HasState(AutofillDriver::LifecycleState expected_state) { … }
class MockContentAutofillDriverFactoryObserver
: public ContentAutofillDriverFactory::Observer { … };
class ContentAutofillDriverFactoryTest
: public content::RenderViewHostTestHarness { … };
TEST_F(ContentAutofillDriverFactoryTest, MainDriver) { … }
class ContentAutofillDriverFactoryTest_WithTwoFrames
: public ContentAutofillDriverFactoryTest { … };
TEST_F(ContentAutofillDriverFactoryTest_WithTwoFrames, TwoDrivers) { … }
class ContentAutofillDriverFactoryTest_WithTwoFrames_PickOne
: public ContentAutofillDriverFactoryTest_WithTwoFrames,
public ::testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ContentAutofillDriverFactoryTest_WithTwoFrames_PickOne,
RenderFrameDeleted) { … }
class ContentAutofillDriverFactoryTest_WithOrWithoutBfCacheAndIframes
: public ContentAutofillDriverFactoryTest,
public ::testing::WithParamInterface<std::tuple<bool>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ContentAutofillDriverFactoryTest_WithOrWithoutBfCacheAndIframes,
SameDocumentNavigation) { … }
TEST_P(ContentAutofillDriverFactoryTest_WithOrWithoutBfCacheAndIframes,
SameOriginNavigation) { … }
TEST_P(ContentAutofillDriverFactoryTest_WithOrWithoutBfCacheAndIframes,
CrossOriginNavigation) { … }
class ContentAutofillDriverFactoryTest_FencedFrames
: public ContentAutofillDriverFactoryTest { … };
TEST_F(ContentAutofillDriverFactoryTest_FencedFrames,
DisableAutofillWithinFencedFrame) { … }
class ContentAutofillDriverFactoryTestLifecycleState
: public ContentAutofillDriverFactoryTest { … };
#define EXPECT_DRIVER_CREATED …
#define EXPECT_LIFECYCLE_CHANGE …
TEST_F(ContentAutofillDriverFactoryTestLifecycleState, NavigateSameDocument) { … }
TEST_F(ContentAutofillDriverFactoryTestLifecycleState, NavigateSameOrigin) { … }
TEST_F(ContentAutofillDriverFactoryTestLifecycleState, NavigateCrossOrigin) { … }
TEST_F(ContentAutofillDriverFactoryTestLifecycleState, CloseTab) { … }
TEST_F(ContentAutofillDriverFactoryTestLifecycleState, NavigateBFCached) { … }
TEST_F(ContentAutofillDriverFactoryTestLifecycleState, NavigatePrerendering) { … }
#undef EXPECT_LIFECYCLE_CHANGE
#undef EXPECT_DRIVER_CREATED
}
}