chromium/components/autofill/content/renderer/form_autofill_issues_browsertest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/content/renderer/form_autofill_issues.h"

#include "base/strings/string_number_conversions.h"
#include "components/autofill/content/renderer/form_autofill_util.h"
#include "components/autofill/content/renderer/test_utils.h"
#include "components/autofill/core/common/field_data_manager.h"
#include "components/autofill/core/common/form_field_data.h"
#include "content/public/test/render_view_test.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/web/web_autofill_client.h"
#include "third_party/blink/public/web/web_form_control_element.h"
#include "third_party/blink/public/web/web_form_element.h"
#include "third_party/blink/public/web/web_local_frame.h"

WebFormControlElement;
WebFormElement;
WebLocalFrame;
WebString;
GenericIssueErrorType;

namespace autofill::form_issues {
namespace {

constexpr CallTimerState kCallTimerStateDummy =;

// Checks if the provided list `form_issues` contains a certain issue type.
// Optionally checks whether the expected issue type has the specified
// `violating_attr`.
bool FormIssuesContainIssueType(const std::vector<FormIssue>& form_issues,
                                GenericIssueErrorType expected_issue,
                                const std::string& violating_attr = "") {}

class FormAutofillIssuesTest : public content::RenderViewTest {};

TEST_F(FormAutofillIssuesTest, FormLabelHasNeitherForNorNestedInput) {}

TEST_F(FormAutofillIssuesTest, FormDuplicateIdForInputError) {}

TEST_F(FormAutofillIssuesTest, FormAriaLabelledByToNonExistingId) {}

TEST_F(FormAutofillIssuesTest, FormAutocompleteAttributeEmptyError) {}

TEST_F(FormAutofillIssuesTest,
       FormInputHasWrongButWellIntendedAutocompleteValueError) {}

// Having an autocomplete attribute that is too large does not trigger issues,
// even if it contains a substring that would match a "honest" developer
// error/typo. This is done to avoid large string comparisons during form
// parsing.
TEST_F(
    FormAutofillIssuesTest,
    FormInputHasWrongButWellIntendedAutocompleteValueError_LargeAutocompleteString_DoNotCalculateIssue) {}

TEST_F(FormAutofillIssuesTest, FormEmptyIdAndNameAttributesForInputError) {}

TEST_F(FormAutofillIssuesTest,
       FormInputAssignedAutocompleteValueToIdOrNameAttributeError) {}

TEST_F(
    FormAutofillIssuesTest,
    FormInputAssignedAutocompleteValueToIdOrNameAttributeErrorUnownedControl) {}

TEST_F(FormAutofillIssuesTest, FormLabelForNameError) {}

TEST_F(FormAutofillIssuesTest, FormLabelForMatchesNonExistingIdError) {}

}  // namespace
}  // namespace autofill::form_issues