#include "components/autofill/core/browser/form_forest.h"
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check_deref.h"
#include "base/containers/contains.h"
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/task_environment.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/form_forest_test_api.h"
#include "components/autofill/core/browser/form_forest_util_inl.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_driver.h"
#include "components/autofill/core/common/form_data_test_api.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
FrameData;
FrameDataSet;
AllOf;
ByRef;
ElementsAre;
ElementsAreArray;
Eq;
Field;
Matcher;
Pointee;
Property;
UnorderedElementsAreArray;
namespace autofill::internal {
namespace {
auto Equals(const FormFieldData& exp);
auto Equals(const FormData& exp);
auto Equals(const FrameData& exp);
template <typename T>
auto ArrayEquals(const std::vector<T>& exp) { … }
template <typename T>
auto UnorderedArrayEquals(const std::vector<T>& exp) { … }
auto Equals(const FormFieldData& exp) { … }
auto Equals(const FormData& exp) { … }
auto Equals(const FrameData& exp) { … }
auto Equals(const FrameDataSet& exp) { … }
auto Equals(const FormForest& exp) { … }
FormData CreateForm() { … }
auto CreateFieldTypeMap(const FormData& form) { … }
Profile;
WithoutValues;
FormData WithValues(FormData form, Profile profile = Profile(0)) { … }
url::Origin Origin(const GURL& url) { … }
url::Origin Origin(std::string_view url) { … }
const std::string kMainUrl("https://main.frame.com/");
const std::string kIframeUrl("https://iframe.frame.com/");
const std::string kOtherUrl("https://other.frame.com/");
FrameDataSet& frame_datas(FormForest& ff) { … }
template <typename T>
std::vector<T> Flattened(const std::vector<std::vector<T>>& xs) { … }
template <typename T>
std::vector<std::vector<T>> Permutations(const std::vector<T>& xs) { … }
template <typename T>
std::vector<std::vector<T>> FlattenedPermutations(
const std::vector<std::vector<T>>& xs) { … }
class FakeAutofillDriver : public TestAutofillDriver { … };
class FormForestTest : public testing::Test { … };
class FormForestTestWithMockedTree : public FormForestTest { … };
class FormForestTestUpdateTree : public FormForestTestWithMockedTree { … };
TEST_F(FormForestTestUpdateTree, MultipleRoots) { … }
TEST_F(FormForestTestUpdateTree, TriggerFormExtractionInDriverFrame) { … }
TEST_F(FormForestTestUpdateTree, SizeLimit) { … }
FormNameVector;
class FormForestTestUpdateOrder
: public FormForestTestUpdateTree,
public ::testing::WithParamInterface<FormNameVector> { … };
class FormForestTestUpdateVerticalOrder : public FormForestTestUpdateOrder { … };
TEST_P(FormForestTestUpdateVerticalOrder, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FormForestTestUpdateHorizontalMultiFormSingleFrameOrder
: public FormForestTestUpdateOrder { … };
TEST_P(FormForestTestUpdateHorizontalMultiFormSingleFrameOrder, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FormForestTestUpdateHorizontalMultiFrameSingleFormOrder
: public FormForestTestUpdateOrder { … };
TEST_P(FormForestTestUpdateHorizontalMultiFrameSingleFormOrder, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FormForestTestUpdateHorizontalMultiFormMultiFrameOrder
: public FormForestTestUpdateOrder { … };
TEST_P(FormForestTestUpdateHorizontalMultiFormMultiFrameOrder, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
ChildFramePredecessors;
class FormForestTestUpdateSplitForm
: public FormForestTestUpdateTree,
public ::testing::WithParamInterface<ChildFramePredecessors> { … };
TEST_P(FormForestTestUpdateSplitForm, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FormForestTestUpdateComplexOrder : public FormForestTestUpdateOrder { … };
TEST_P(FormForestTestUpdateComplexOrder, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(FormForestTestUpdateTree, EraseForm_FieldRemoval) { … }
TEST_F(FormForestTestUpdateTree, EraseForm_ParentReset) { … }
class FormForestTestUpdateEraseFrame
: public FormForestTestUpdateTree,
public ::testing::WithParamInterface<bool> { … };
TEST_P(FormForestTestUpdateEraseFrame, EraseFrame_FieldRemoval) { … }
TEST_P(FormForestTestUpdateEraseFrame, EraseFrame_ParentReset) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FormForestTestUpdateFieldChange : public FormForestTestUpdateTree { … };
struct FieldSpec { … };
class FormForestTestUpdateFieldRemove
: public FormForestTestUpdateFieldChange,
public ::testing::WithParamInterface<FieldSpec> { … };
TEST_P(FormForestTestUpdateFieldRemove, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FormForestTestUpdateFieldAdd
: public FormForestTestUpdateFieldChange,
public ::testing::WithParamInterface<FieldSpec> { … };
TEST_P(FormForestTestUpdateFieldAdd, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
struct FieldMoveSpec { … };
class FormForestTestUpdateFieldMove
: public FormForestTestUpdateFieldChange,
public ::testing::WithParamInterface<FieldMoveSpec> { … };
TEST_P(FormForestTestUpdateFieldMove, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(FormForestTestUpdateTree, Converge) { … }
TEST_F(FormForestTestUpdateTree, RemoveFrame) { … }
class FormForestTestFlatten : public FormForestTestWithMockedTree { … };
TEST_F(FormForestTestFlatten, SingleFrame) { … }
class FormForestTestFlattenHierarchy
: public FormForestTestFlatten,
public ::testing::WithParamInterface<std::string> { … };
TEST_P(FormForestTestFlattenHierarchy, TwoFrames) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FormForestTestUnflatten : public FormForestTestWithMockedTree { … };
TEST_F(FormForestTestUnflatten, MainFrame) { … }
TEST_F(FormForestTestUnflatten, ChildFrame) { … }
TEST_F(FormForestTestUnflatten, LargeTree) { … }
TEST_F(FormForestTestUnflatten, SameOriginPolicy) { … }
TEST_F(FormForestTestUnflatten, SameOriginPolicyNoValuesErased) { … }
TEST_F(FormForestTestUnflatten, InterruptedSameOriginPolicy) { … }
TEST_F(FormForestTestUnflatten, MainOriginPolicy) { … }
TEST_F(FormForestTestUnflatten, MainOriginPolicyWithoutSharedAutofill) { … }
class FormForestTestUnflattenSharedAutofillPolicy
: public FormForestTestUnflatten { … };
TEST_F(FormForestTestUnflattenSharedAutofillPolicy, FromMainOrigin) { … }
TEST_F(FormForestTestUnflattenSharedAutofillPolicy, FromOtherOrigin) { … }
TEST_F(FormForestTest, FrameDataComparator) { … }
struct ForEachInSetDifferenceTestParam { … };
class ForEachInSetDifferenceTest
: public ::testing::Test,
public ::testing::WithParamInterface<ForEachInSetDifferenceTestParam> { … };
bool operator==(ForEachInSetDifferenceTest::Dummy x,
ForEachInSetDifferenceTest::Dummy y) { … }
TEST_P(ForEachInSetDifferenceTest, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}